【问题标题】:SSRS IIF and Switch functionsSSRS IIF 和开关功能
【发布时间】:2020-10-23 19:46:30
【问题描述】:

我有一个报告,我想根据大陆列值更改列(销售额)的背景颜色。下面是洲列值。

我在销售栏(背景色)下尝试了以下表达式,

=IIF(Fields!column.Value ="4th Quarter",
 SWITCH (
                   Fields!continents.Value ="Asia", "Green",
                   Fields!continents.Value = "N America","LIMEGREEN",
                   Fields!continents.Value ="S America","Yellow",
                   Fields!continents.Value = "Europe", "Red"  
         )
, "Dummy Value")  

当我预览报表时,我只能看到所有行的绿色。我知道 SSRS 中的 Switch 函数将返回它找到的第一个表达式。
我也尝试过只使用 IIF 条件,仍然是同样的问题。有什么方法可以实现吗?

【问题讨论】:

    标签: reporting-services ssrs-2012 ssrs-tablix


    【解决方案1】:

    您是否尝试过类似以下的方法?

    =IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value ="Asia"),"Green",
         IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value = "N America"),"LIMEGREEN",
            IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value ="S America"),"Yellow",
                IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value = "Europe"), "Red",
                "Dummy Value"))))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多