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

1 comment:

Shop 99 said...

Thank you for taking the time to publish this information very useful! I've been looking for books of this nature for a way too long. I'm just glad that I found yours. Looking forward for your next post. Thanks :)

Purchase Blood Pressure Monitor

Blog Archive

Followers