SSRS Conditional Formatting Switch or IIF

拟墨画扇 提交于 2019-11-27 04:04:38

问题


I currently have the following 2008 SSRS Report and I want to conditionally format background of the columns based on some logic.

I have three columns and two of which I would like to change the background color. Columns "Current Risk Level", "Trend", "Tolerance". Each contains rows of either Low, Moderate, Medium, High, Very High

For column "Current Risk Level" I would like Low="Green",Moderate="Blue",Medium="Yellow",High="Orange",Very High="Red"

For column "Tolerance" I would like Low="Red",Moderate="Orange",Medium="Yellow",High="Blue",Very High="Green"

I don't know how to set up a SWITCH or IIF function to accomplish this.

Any help would be really appreciated!


回答1:


To dynamically change the color of a text box goto properties, goto font/Color and set the following expression

=SWITCH(Fields!CurrentRiskLevel.Value = "Low", "Green",
Fields!CurrentRiskLevel.Value = "Moderate", "Blue",
Fields!CurrentRiskLevel.Value = "Medium", "Yellow",
Fields!CurrentRiskLevel.Value = "High", "Orange",
Fields!CurrentRiskLevel.Value = "Very High", "Red"
)

Same way for tolerance

=SWITCH(Fields!Tolerance.Value = "Low", "Red",
Fields!Tolerance.Value = "Moderate", "Orange",
Fields!Tolerance.Value = "Medium", "Yellow",
Fields!Tolerance.Value = "High", "Blue",
Fields!Tolerance.Value = "Very High", "Green")


来源:https://stackoverflow.com/questions/18538222/ssrs-conditional-formatting-switch-or-iif

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!