SSRS文本框格式取决于列IS NOT NULL

时间:2016-10-07 08:59:46

标签: reporting-services textbox formatting

我有一个百分比的tablix作为数据。我想根据其他列(inc_number,crq_number,wlg_number)中的结果格式化该框。如果它们中的任何一个具有IS NOT NULL的值,则将它们设为绿色(如果不使其变为红色)。

我正在思考

=IIF((ISNOTHING(Fields!inc_number)),"Red","green")
OR IIF((ISNOTHING(Fields!crq_number)),"Red","green")
OR IIF((ISNOTHING(Fields!wlg_number)),"Red","green") 

2 个答案:

答案 0 :(得分:0)

为什么不使用AND

=iif(isnothing(Fields!inc_number) 
         and isnothing(Fields!crq_number) 
         and isnothing(Fields!wlg_number),
     "Red",
     "Green")

答案 1 :(得分:0)

尝试:

=Switch(
  ISNOTHING(Fields!inc_number.Value) OR Fields!inc_number.Value = "","Red",
  ISNOTHING(Fields!crq_number.Value) OR Fields!crq_number.Value = "","Red",
  ISNOTHING(Fields!wlg_number.Value) OR Fields!wlg_number.Value = "","Red",
  true,"Green"
) 

如果有帮助,请告诉我。