Thursday, March 8, 2012

custom formatting codes

I need to create formatting that is a bit different from the standard formatting codes in SSRS. Specifically, I need to have the percent sign come right after the number (SSRS inserts a space), whereas with currency fields I need to inster a space between the $ and the number (SSRS has no space). Is there any way to do this with custom formatting codes, or will I need to go through and add the percent and dollar sign in manually to each field so that the space can either be removed or inserted?

just use "#,###%" and "$ #,###" in the formatting condition of textboxes

PS when you put % in the specified manner SSRS multiply the result by 100 so you may require to divide your final result by 100. Just depends.

Priyank

|||Priyank, thanks! This works, but there's one problem. I can't seem to get the decimals if they are zero. In other words $5.00 just displays as $5. I tried using "$#,###.##" but that has the same problem... Any way to get the zeros to show?
|||

$ #,###.#0

|||Great, that did the trick! Thanks!
|||Ok, one more related question - how would I within this code specify using parens for negative values instead of a minus sign? I tried playing around with adding parens to the code, but now luck...
|||

I believe you need to use the following as your formatting code, where $ #,###.#0 is what you were using successfully for positive numbers:

Code Snippet


$ #,###.#0;($ #,###.#0);Zero

(replace Zero above with whatever you want the value 0 to look like)

... see http://msdn2.microsoft.com/en-us/library/0c899ak8(VS.80).aspx

>L<

|||Thanks so much!

I'll try that out.

No comments:

Post a Comment