首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >根据参数值更改使用的SSRS表达式

根据参数值更改使用的SSRS表达式
EN

Stack Overflow用户
提问于 2019-08-13 05:41:47
回答 1查看 191关注 0票数 0

我有一个SSRS表达式,需要根据传递的参数更改其中的值。

代码语言:javascript
复制
="Double Coat " & 
IIF((First(Fields!rr_paintpayout.Value, "Market") = "Task-Based") OR (First(Fields!rr_paintpayout.Value, "Market") = "Hourly"),
    IIF(Fields!rr_taskpayoutaddonoption.Value = "Floorplan Configuration",
        Fields!rr_1x1.Value & " - "& Fields!rr_1x4.Value**,
        IIF(Fields!rr_taskpayoutaddonoption.Value = "Fixed Quantity",
            Fields!rr_fixedamount.Value & " each",
            IIF(Fields!rr_taskpayoutaddonoption.Value = "Fixed Hourly",
                Fields!rr_fixedamount.Value & " hourly",
                Fields!rr_fixedamount.Value))),
    IIF(First(Fields!rr_paintpayout.Value, "Market") = "Variable Percent",
        IIF(Fields!rr_variablepercentaddonselection.Value = "Sq Ft Variable Pricing",
            Fields!rr_fixedamount.Value & " sq. ft.",
            IIF(Fields!rr_variablepercentaddonselection.Value = "Fixed Quantity",
                Fields!rr_fixedamount.Value & " each",
                IIF(Fields!rr_variablepercentaddonselection.Value = "Fixed Hourly",
                    Fields!rr_fixedamount.Value & " hourly",
                    Fields!rr_fixedamount.Value))), 0.00))

我的参数是一个整数,基于1、2、3或4。我需要更改表达式的第三行。我曾尝试将整个表达式包装在IIF中,但我无法运行报告。我所想的是

代码语言:javascript
复制
  ="Double Coat " & 
    IIF((First(Fields!rr_paintpayout.Value, "Market") = "Task-Based") OR (First(Fields!rr_paintpayout.Value, "Market") = "Hourly"),
        IIF(Fields!rr_taskpayoutaddonoption.Value = "Floorplan Configuration",
      IIF((Parameters.Bedrooms.Value =1 )
            Fields!rr_1x1.Value & " - "& Fields!rr_1x4.Value)),
 IIF((Parameters.Bedrooms.Value =2 )
            Fields!rr_2x1.Value & " - "& Fields!rr_3x4.Value)),
            IIF(Fields!rr_taskpayoutaddonoption.Value = "Fixed Quantity",
                Fields!rr_fixedamount.Value & " each",
                IIF(Fields!rr_taskpayoutaddonoption.Value = "Fixed Hourly",
                    Fields!rr_fixedamount.Value & " hourly",
                    Fields!rr_fixedamount.Value))),
        IIF(First(Fields!rr_paintpayout.Value, "Market") = "Variable Percent",
            IIF(Fields!rr_variablepercentaddonselection.Value = "Sq Ft Variable Pricing",
                Fields!rr_fixedamount.Value & " sq. ft.",
                IIF(Fields!rr_variablepercentaddonselection.Value = "Fixed Quantity",
                    Fields!rr_fixedamount.Value & " each",
                    IIF(Fields!rr_variablepercentaddonselection.Value = "Fixed Hourly",
                        Fields!rr_fixedamount.Value & " hourly",
                        Fields!rr_fixedamount.Value))), 0.00))

这基本上就是在顶部添加Parameters.Value。有没有人有任何成功的或者更好的方法来改变正在使用的表达式?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-08-13 14:29:02

当我在记事本中使用您的表达式并检查括号时,它不匹配。我修改了你的表达式,我发现你的表达式中缺少一个错误的表达式。你可能会想要检查一下。下面是我从你的例子中创建的表达式。

代码语言:javascript
复制
="Double Coat " & IIF(First(Fields!rr_paintpayout.Value, "Market") = "Task-Based" OR First(Fields!rr_paintpayout.Value, "Market") = "Hourly",
IIF(Fields!rr_taskpayoutaddonoption.Value = "Floorplan Configuration",
IIF(Parameters.Bedrooms.Value =1,
Fields!rr_1x1.Value & " - "& Fields!rr_1x4.Value,
IIF(Parameters.Bedrooms.Value =2 ,
Fields!rr_2x1.Value & " - "& Fields!rr_3x4.Value,
IIF(Fields!rr_taskpayoutaddonoption.Value = "Fixed Quantity",
Fields!rr_fixedamount.Value & " each",
IIF(Fields!rr_taskpayoutaddonoption.Value = "Fixed Hourly",
Fields!rr_fixedamount.Value & " hourly",Fields!rr_fixedamount.Value)))),
IIF(First(Fields!rr_paintpayout.Value, "Market") = "Variable Percent",
IIF(Fields!rr_variablepercentaddonselection.Value = "Sq Ft Variable Pricing",
Fields!rr_fixedamount.Value & " sq. ft.",
IIF(Fields!rr_variablepercentaddonselection.Value = "Fixed Quantity",
Fields!rr_fixedamount.Value & " each",
IIF(Fields!rr_variablepercentaddonselection.Value = "Fixed Hourly",
Fields!rr_fixedamount.Value & " hourly",Fields!rr_fixedamount.Value))),
false)),
0.00)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57468599

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档