Tuesday, November 15, 2005

SQL Reporting Services: Formatting Data

One of the cool things I discovered today was that you can use .NET formatting codes when formatting data for output with reporting services

1. Right Click on the field
2. goto properties
3. Check the Custom Radio box and type one in

you can type in 'c' for currency formatting that is locale specific, 'd' for decimal output, or 'p' for percentage.

I needed a custom one that had a number formatted by commas with no decimal places so I simply typed in ###,###,### and viola!

More info on format strings
Standard numeric formattings: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandardnumericformatstrings.asp

Custom numeric formattings: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp

Date time formatting: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemGlobalizationDateTimeFormatInfoClassTopic.asp


Post a Comment

<< Home