Your company's ad could live here and reach over 50,000 people a month!

Share This Post

SSRS Tip – Formatting data as a percent

Formatting data within SSRS is fairly easy, for each field there is a format property. By referencing and applying the standard format strings (link below), converting data to something like a percent is simple. The percent is symbolized by a “P” . This reporting case was a little different, as the data was provided as numeric and provided as a percentage. If I used the percentage symbol, the data would have been converted to something much larger; 2700.00 %, instead of the more realistic 27.00 % (example below).

Additionally, there was a need to format the numeric data to a Fixed decimal, with 2 decimal places (hint: format code = “F2”)

clip_image001

To solve this issue, in design mode, right click the field, select Expression… use the expression builder property sheet, we first format the numeric field to fixed decimal, 2 decimal places, then append the percent sign.

In somewhat symbolic language, it looks like this:

= FORMAT ( <field>, “FormatCode”) & “ %”

Applied to the actual field:

clip_image002

Results:

clip_image003

Reference

Standard Numeric Format Strings

http://msdn.microsoft.com/en-us/library/dwhawy9k

Share This Post

Specializing in System Center Products: Configuration Manager 2007, Operations Manager 2007, Desired Configuration Management, SMS 2003, software distribution, ITMU, SUS & WSUS. Database products and solutions: Microsoft SQL Server 2005 & 2008, Business Intelligence Development Studio, Analysis Server, Reporting Services, Integration Services. Microsoft Windows Server 2003 & 2008, SharePoint, PerformancePoint, Active Directory, DNS, Group Policy, Security, VBScript, ASP, Visual Basic, WMI, HTML and XML.

Leave a Reply