Sample Header Ad - 728x90

Making Switches Work in SSRS

0 votes
1 answer
314 views
I'm trying to get my report to display different color cells, depending on the condition. This is my current code: =Switch(Fields!DaysToExpiration.Value > 31, "Green", Fields!User_Certification_Status.Value = 8, "Firebrick”, Fields!User_Certification_Status.Value = 13, “Orange”, Fields!User_Certification_Status.Value = 11, “Orange”, Fields!User_Certification_Status.Value = 10, “Orange”, Fields!User_Certification_Status.Value = 12, “Orange”, Fields!DaysToExpiration.Value <= 30, "Yellow", 1=1, "Gray") So, my problem lies with the last part of the code. I'm using a matrix view, which means there are some cells where there is no data. SSRS is treating these like they have a value though (I'm assuming 0). This means that all the blank ones automatically turn to yellow, rather than gray. How can I get around this? Thank You.
Asked by BoyGeorge (3 rep)
Feb 8, 2018, 05:07 PM
Last activity: Feb 8, 2018, 05:27 PM