如何检查多值参数中是否选择了某个值
在 SSRS 2008 中,我使用多值参数为特定参数选择多个值。
在我的报告中,我有条件格式:如果选择了该项目,则特定标签必须为蓝色;否则它会保持黑色。我的直觉是尝试使用 SQL 方式 - 但我错了:-)
Switch(
Fields!groupType.Value = "firstValue", "#00ffffff",
Fields!groepType.Value = "secondValue", "Tomato",
Fields!groepType.Value = "thirdValue", "DimGray",
Fields!groepType.Value IN Parameters!p_myMultipleValueParameter.Values, "Blue"
)
处理这个问题的正确方法是什么?
In SSRS 2008, I use Multi-value parameters to, well, select multiple values for a particular parameter.
In my report I have conditional formatting: a particular label has to be blue if the item is selected; otherwise it will stay black. My intuition was trying it the SQL way - but I was wrong :-)
Switch(
Fields!groupType.Value = "firstValue", "#00ffffff",
Fields!groepType.Value = "secondValue", "Tomato",
Fields!groepType.Value = "thirdValue", "DimGray",
Fields!groepType.Value IN Parameters!p_myMultipleValueParameter.Values, "Blue"
)
What is the right way to handle this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为最干净的方法可能是以下
每次运行联接可能效率低下,因为分配额外字符串的开销,特别是如果该函数将在一个大列表上运行,或者例如在网格的每行上运行一次。
I think the cleanest way is probably the following
Running a join each time may be inefficient because of the overhead of allocating extra strings, especially if the function will be run over a large list, or once per row of a grid, say.