我正在使用ReportBuilder3.0,试图根据用户选择的参数获得一个动态标题。
误差
文本的值表达式‘Textbox29.Paragraps2.TextRuns’包含一个错误: BC32017逗号,‘),或预期的有效表达式延续。
当我使用这个开关语句时,我会得到这个错误
=SWITCH(
Parameters!LineCalled.Count = 3, "All Lines",
Parameters!LineCalled.Count = 2, "Both Notts Lines",
Parameters!LineCalled.Count = 1 AND
Parameters!LineCalled.Value = "01156842190", "Order Line",
Parameters!LineCalled.Count = 1 AND
Parameters!LineCalled.Value = "01156842191", "Overflow Line",
Parameters!LineCalled.Count = 1 AND
Parameters!LineCalled.Value = "393607", "Belfast Line"
)或者这个IIF
=IIF(Parameters!LineCalled.Count = 3, "All Lines",
IIF(Parameters!LineCalled.Count = 2, "Both Notts Lines",
IIF(Parameters!LineCalled.Count = 1 AND
Parameters!LineCalled.Value = "01156842190", "Order Line",
IIF(Parameters!LineCalled.Count = 1 AND
Parameters!LineCalled.Value = "01156842191", "Overflow Line",
IIF(Parameters!LineCalled.Count = 1 AND
Parameters!LineCalled.Value = "393607", "Belfast Line","Other"
)))))我遗漏了什么?
发布于 2019-12-02 10:10:19
您所缺少的是,您的参数似乎是一个多值参数,因此,每当您想要访问唯一选定的值时,都应该使用表达式Parameters!LineCalled.Value(0)。
例如:
=SWITCH(
Parameters!LineCalled.Count >= 3, "All Lines",
Parameters!LineCalled.Count = 2, "Both Notts Lines",
Parameters!LineCalled.Value(0) = "01156842190", "Order Line",
Parameters!LineCalled.Value(0) = "01156842191", "Overflow Line",
Parameters!LineCalled.Value(0) = "393607", "Belfast Line"
)https://stackoverflow.com/questions/59091045
复制相似问题