我想写一个Reporting Services“Expression”,基本上表现如下(伪代码)……
if ([Fields!StateProvinceId.Value] == 1) { return "Ontario"; } else if ([Fields!StateProvinceId.Value] == 2) { return "Quebec"; } else if ([Fields!StateProvinceId.Value] == 3) { return "Manitoba"; } // ... // more cases same pattern
我没有看到这种类型的逻辑我是否需要嵌套一堆IIF?
=IIF(Fields!StateProvinceId.Value = 1,"Ontario",IIF(Fields!StateProvinceId.Value = 2,"Quebec",IFF(Fields!StateProvinceId.Value = 3,"Manitoba","Unknown Province")))
解决方法
你试过一个switch语句吗?
= Switch( Fields!StateProvinceId.value=1,Fields!StateProvinceId.value=2,Fields!StateProvinceId.value=3,"Manitoba")