【发布时间】:2016-02-25 14:07:41
【问题描述】:
我的 Tablix 字段之一中有以下语句,并且在呈现报告时刚刚收到 #error。我不确定确切的问题,但如果有人能指出我正确的方向,那将很有帮助;
=IIF(Fields!inflowType.Value="1",
Switch(
Fields!inflowTaxTreatment.Value = "0","Amount is Pre-Tax",
Fields!inflowTaxTreatment.Value = "1","Amount is Post-Tax/Not Taxed") ,Nothing)
Or
IIF(Fields!inflowType.Value = "3",
Switch(
Fields!inflowTaxTreatment.Value = "0","Tax Deferred",
Fields!inflowTaxTreatment.Value="1","Tax Free"),Nothing)
Or
IIF(Fields!inflowType.Value="0",
Switch(
Fields!inflowTaxTreatment.Value="0","0% Taxable",
Fields!inflowTaxTreatment.Value="1","50% Taxable",
Fields!inflowTaxTreatment.Value="2","85% Taxable"),Nothing)
基本上我不知道我是否可以使用嵌套的 switch 语句来实现相同的目标,我认为这是对另一个已接受的线程的建议,但它对我/不起作用。
【问题讨论】:
-
它不起作用,因为您没有正确使用 OR 运算符。您有 IIF() OR IIF () OR IIF() or 运算符仅适用于 IIF 内的谓词表达式
IIF(this OR this, do this, IIF(this or this, do this, do that)) -
感谢您的建议,这实际上是我最初的想法,我得到了没有表达式接受这么多参数的错误,所以我寻找了另一种方法
标签: reporting-services ssrs-2012 reportbuilder3.0