Friday, May 8, 2015

Need help in creating Color Combination logic for Matrix report

Hi Anuj,

Based on your description, you want to fill the text box background color by risk_id. And you also need to fill the color when no risk_id exists in textbox. Right?

In SQL Server Reporting Service, you could achieve this goal by using Program Flow function in the expression. For example, use the Switch() function. We can apply condition True as logic expression for no value scenario. We have tested your case in our environment. Please refer to the expression in "Fill" tab below:
=Switch(Field!risk_id.Value=1,"Red",Field!risk_id.Value=2,"Teal",Field!risk_id.Value=3,"Yellow",Field!risk_id.Value=4,"Gray",Field!risk_id.Value=5,"Maroon",True,"Aqua")

The result is like below:

If you have any more questions, please feel free to aks.

Regards,
Shrek Li

No comments:

Post a Comment