SSRS 中的条件着色单元格

Conditionally Coloring Cells in SSRS

我正在优化我在 SSRS 中的一份报告,但在使用一行代码时遇到了一些困难。基本上我想要的是检查单元格是否为空,或者是否有数据。如果它是空白的,我需要将单元格颜色更改为红色。如果它有数据,我需要它保持透明。这是我写的。

=iif(Isnothing(Fields!MedServices.Value)= "True", "Red", iif(Isnothing(Fields!MedServices.Value)= "False", "Transparent"))

当我去保存这个时,我得到了以下错误:

The BackgroundColor expression for the text box ‘MedServices’ contains an error: [BC30455] Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.

我知道这一定是我的一个带有括号的愚蠢错误,但我不知道我在哪里犯了错误。感谢任何帮助。

IsNothing() 函数 returns 布尔数据类型,true 或 false 它是 IIF() 函数的有效表达式。

尝试:

=iif(Isnothing(Fields!MedServices.Value) or Fields!MedServices.Value="",
"Red", "Transparent")