September 15, 2010 at 4:35 am
Hi. I have a report that accounts run via reporting services then export to excel. There main moan is the formatting once in excel.
The following is representative of code within the dataset:
ROUND((CurItemValue / Quantity * QuantityOutstanding),2) AS CurValueOutstanding,
Question: Can the code be modified so when exported to excel it is in the desired number format (as opposed General)?
I would guess the answer is no as the formatting is down to Excel.
Kind Regards,
Phil.
-------------------------------------------------------------------------------------
A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."
Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '
Tommy Cooper
September 15, 2010 at 7:53 am
Have you tried setting the format property of the text box that contains the value you are having issues with? Instead of using the FORMAT() function inside of an expression, use the property of the text box. That should transfer over to excel when it's exported, or at least it does when I export dates formatted as such.
You probably want to use the standard Decimal format code from here http://msdn.microsoft.com/en-us/library/aa720653.aspx
For to convert .050 to .05 you would use d2
Hopefully that helps,
-Luke.
September 15, 2010 at 9:52 am
You can select multiple, or single cells to set the format properties as Luke says above.
Examples of what you may put in the format field are :
c2 (currency, 2 decimal places)
n2 (number, 2 decimal places)
n0 (number, no decimal)
d (date format)
t (time format)
You can google this issue and come up with numerous formats.
September 15, 2010 at 10:56 am
tsmith-960032 (9/15/2010)
You can select multiple, or single cells to set the format properties as Luke says above.Examples of what you may put in the format field are :
c2 (currency, 2 decimal places)
n2 (number, 2 decimal places)
n0 (number, no decimal)
d (date format)
t (time format)
You can google this issue and come up with numerous formats.
Thanks for the correction there... I just relized I was thinking 2 decimal places and is why I said to use d2. But that's a date format.
Sorry for any confusion. N2 was what I meant.
-Luke.
September 15, 2010 at 11:18 am
Thanks for posting, I will look into the formatting as suggested.
Many Thanks,
Phil.
-------------------------------------------------------------------------------------
A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."
Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '
Tommy Cooper
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy