MSBI (SSIS/SSRS/SSAS) Online Training

Monday, March 9, 2009

SSRS: Conditional Formatting

Hi,
In reports we have to set different conditions on reports various on the requirement.
And also we can generate reports with colors to give a bright look by the customers/clients.
Expressions are something I have found to be very handy when using SSRS. A report I needed to setup had to list when a user had last visited a site. Since they needed to make a visit every three years the report listed the last visit date and the date three years out (this was all done is the stored procedure). Sometimes folks may get behind and I wanted to highlight the sites that were past due.
The report needed to be able to be sorted by a date, town or country so I could not just list the sites by date and have the overdue visits all at the top. I decided to simply have the overdue sites listed in bold. To accomplish this I added the following to the TableRow’s font weight property:
=iif (FORMAT(Fields!ThreeYearsOut.Value, "MM/dd/yyyy") < Today(), "Bold", "Normal")
This "How to" guide provides ideas & code samples on using color to improve your users understanding of the data in your reports. It includes using gradients of color in your tables & charts. It also covers using color to represent a second dimension &/or multiple levels of data in a hierarchy.
http://blogs.msdn.com/davidlean/archive/2009/02/17/sql-reporting-how-to-conditional-color-1-4-the-basics-report-expressions-custom-code.aspx