Home

Monday, April 21, 2014

SQL Server Reporting Services, Conditional Formatting Using Switch Function



Description

This post explains how to configure conditional formatting in an SSRS report, for an example that has three conditions.

Solution 

In order to achieve the desired result, we can modify the Background Color property in the SSRS report with a formula, using the Switch function. As described in an MSDN article, "The Switch function returns the value associated with the first expression in a series that evaluates to true" (MSDN, 2012). In the example below we are setting the Variance field Red if the value is less than -100,000, Yellow if the value is between -100,000 and 0, and Green if the value is greater than or equal to 0.



References

MSDN (2012). Expression Examples (Report Builder and SSRS). Retrieved April 21, 2014 from http://msdn.microsoft.com/en-us/library/ms157328.aspx

Blog Archive

Followers