SSRS- Complex If语句改变背景颜色

时间:2014-07-03 22:53:24

标签: reporting-services

我使用以下表达式格式化报告的底行

=IIf(Fields!EndPoint.Value="Total Sales Division"  or 
Fields!EndPoint.Value="Total End Point" or 
Fields!EndPoint.Value="Total IP-Relay" or 
Fields!EndPoint.Value="Total ClearCaptions","CornflowerBlue",
iif(Fields!Projection.Value="Actual","LimeGreen","LightBlue"

它工作得很好,直到它击中列中的零并且格式化单元格,其中假攻击为浅蓝色。我确实使用了= iif(isnothing(Sum(Fields!MnthSum.Value)),0,Sum(Fields!MnthSum.Value)) 插入zers是我空白的地方。我假设我必须将其纳入我的公式中?

我试过玩这个

=IIf(Fields!EndPoint.Value="Total Sales Division" and Sum(Fields!MnthSum.Value)=0 or 
Fields!EndPoint.Value="Total End Point" or 
Fields!EndPoint.Value="Total IP-Relay" or 
Fields!EndPoint.Value="Total ClearCaptions","CornflowerBlue",
iif(Fields!Projection.Value="Actual","LimeGreen","LightBlue"

这会使该部分中的所有内容变成浅蓝色并刮掉CornflowerBlue。

任何建议都会很棒,并提前致谢。

1 个答案:

答案 0 :(得分:0)

我认为您需要添加括号以使您的逻辑正确评估 - 可能是这样的:

=IIf( ( Fields!EndPoint.Value="Total Sales Division" and Sum(Fields!MnthSum.Value)=0 ) or Fields!EndPoint.Value="Total End Point" or Fields!EndPoint.Value="Total IP-Relay" or Fields!EndPoint.Value="Total ClearCaptions","CornflowerBlue", iif(Fields!Projection.Value="Actual","LimeGreen","LightBlue"