25

我目前有以下 2008 年 SSRS 报告,我想根据一些逻辑有条件地格式化列的背景。

我有三列,其中两列我想更改背景颜色。“当前风险水平”、“趋势”、“容忍度”列。每个包含低、中、中、高、非常高的行

对于“当前风险级别”列,我想要 Low="Green",Moderate="Blue",Medium="Yellow",High="Orange",Very High="Red"

对于“公差”列,我想要 Low="Red",Moderate="Orange",Medium="Yellow",High="Blue",Very High="Green"

我不知道如何设置 SWITCH 或 IIF 函数来完成此操作。

任何帮助将非常感激!

4

1 回答 1

56

要动态更改文本框转到属性的颜色,请转到字体/颜色并设置以下表达式

=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"
)

宽容的方式相同

=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")
于 2013-08-30T17:20:25.430 回答