1

在 Reporting Services 2008 R2 的 Tablix 中,我有以下代码可以根据值更改背景颜色:

=switch(Fields!Mean_Difference.Value > 0,"#DA9694",
        Fields!Mean_Difference.Value = 0,"#FCD5B4",
        Fields!Mean_Difference.Value < 0,"#C4D79B")

但是,当有一个 NULL 值时,它会将其格式化为与 0 相同的颜色,问题是我不希望它被格式化,只是留空。我试过使用 isNothing() 没有运气,似乎找不到答案。

这可以做到吗?

4

1 回答 1

1

这行得通吗?(你应该在 ssrs 中使用 Nothing 作为透明背景)。您确定该值绝对为空吗?

=iif(IsNothing(Fields!Mean_Difference.Value)
,Nothing
,switch(Fields!Mean_Difference.Value > 0,"#DA9694",
    Fields!Mean_Difference.Value = 0,"#FCD5B4",
    Fields!Mean_Difference.Value < 0,"#C4D79B"))
于 2013-11-26T14:51:43.337 回答