December 3, 2007 at 4:34 am
Has anyone figured out how to take a field that produces an INT and format it with commas every three digits?
I.E., I have a field called MyField which can produce anything from a -2 to 2205138. The end user wants anything that's above 3 digits (either in the negatives or positives) to show commas. So 2205138 becomes 2,205,138.
Any thoughts on how I can format the field on the SSRS side?
December 3, 2007 at 4:48 am
Brandie,
right-click on the textbox which contains your values and select properties. Go to the Format tab and in the field "Format code" enter the value "#,#".
This will format the values the way you want.
[font="Verdana"]Markus Bohse[/font]
December 3, 2007 at 5:33 am
Thanks, Markus! Worked like a charm. @=)
Is there a weblink or a BOL topic that I can search to see all the different types of format codes one can use in SSRS?
December 3, 2007 at 6:05 am
Sorry but I can't help you with this. I found the documentation in BOL not that good when it comes to formatting options. What I did a lot was looking into other reports like the SSMS reports and see how things are handled in those.
[font="Verdana"]Markus Bohse[/font]
December 3, 2007 at 6:08 am
Markus,
What topic did you search in BOL to find the above? I couldn't find it no matter what I tried.
Thanks,
December 3, 2007 at 6:48 am
Actually I didn't look in BOL.
I have a short list of Tips & Tricks I often use in reports, and that's just one of them.
[font="Verdana"]Markus Bohse[/font]
December 3, 2007 at 12:48 pm
FOUND IT! @=)
Markus (and anyone else looking for this information):
Check out the following links for code to use the Properties->Format->Format Code box of a text box:
Custom formatting: http://msdn2.microsoft.com/en-us/library/7x5bacwt(VS.71).aspx
Standard formatting: http://msdn2.microsoft.com/en-us/library/dwhawy9k(VS.71).aspx
And to do both negatives & commas, use: #,#;(#,#)
Hope this helps someone out in the future.
January 8, 2008 at 4:35 pm
Those links are awesome. I use the experiment method where I try everything under the sun and finally give up, then ask someone else. Thanks guys.
January 9, 2008 at 3:56 am
I'm glad someone found them useful. @=)
January 9, 2008 at 9:40 am
Brandie and Markus,
I second the Thanks! Thanks! I have just begun to work with SSRS in SQL Server 2005. I have used Crystal Reports for quite a few years.
"Key"
MCITP: DBA, MCSE, MCTS: SQL 2005, OCP
January 9, 2008 at 9:58 am
Here are some other links that may be helpful.
Expression examples: http://msdn2.microsoft.com/en-us/library/ms157328.aspx
Function Definitions: http://msdn2.microsoft.com/en-us/library/c157t28f(vs.71).aspx
Best Practices for reporting:
http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterSQLReportingServices.aspx
http://msdn2.microsoft.com/en-us/library/bb395166.aspx
[font="Comic Sans MS"]toolman[/font]
[font="Arial Narrow"]Numbers 6:24-26[/font]
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply