带有开关错误

时间:2016-02-25 14:07:41

标签: reporting-services ssrs-2012 reportbuilder3.0

我在我的一个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语句来实现同样的目的,我在另一个被接受的线程上看到了这个建议,但它对我来说不起作用。

1 个答案:

答案 0 :(得分:1)

尝试

=IIF(Fields!inflowType.Value="1",
    Switch(
          Fields!inflowTaxTreatment.Value = "0","Amount is Pre-Tax",     
          Fields!inflowTaxTreatment.Value = "1","Amount is Post-Tax/Not Taxed") ,  
IIF(Fields!inflowType.Value = "3",
    Switch(
         Fields!inflowTaxTreatment.Value = "0","Tax Deferred",
         Fields!inflowTaxTreatment.Value="1","Tax Free")
,
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)
))

我不确定,但我认为这是你想要的,请告诉我这是否对你有帮助。