简体   繁体   English

SSRS 2012-将参数中的多个值发送到主数据集

[英]SSRS 2012 - Sending multiple values in parameter to main dataset

I have a report that is up and running but I need to restrict the data on a parameter that takes multiple string-valued staff codes. 我有一个正在运行的报告,但我需要将数据限制在采用多个字符串值员工代码的参数上。

  1. I created a parameter called Practioner which is a text type, ticked on Allow Multiple values and also on Visible . 我创建了一个名为Practioner的参数,该参数是文本类型,在Allow Multiple值Visible上打勾。

  2. In the available values , I made this code come from the field called mbillaty from the dataset3 under the Get values from a query option. 可用值 ,我做了这个代码来自从查询选项下获取值的dataset3称为mbillaty领域。 I've checked data3 is fine in SQL server. 我检查过data3在SQL Server中是否正常。

3.Now, I've gone to my dataset1 where all the reporting data sits then put the parameter, with the name ? 3.现在,我进入了所有报告数据所在的数据集1,然后输入名称为的参数 and =Join(Parameters!Practitioner.Value,", ") for the parameter value. = Join(Parameters!Practitioner.Value,“,”)作为参数值。 Then in the query, in the where clause, I've put: ......mbility in (?) What should this SSRS be interpreting as is : .......mbility in ('AAB','KKR','RDR') , if the user picked these three staffs. 然后在查询中的where子句中,我输入: ......(())中的移动性此SSRS应解释为: .......((AAB',')中的移动性KKR','RDR') ,如果用户选择了这三个员工。

When I run the report, it definitley works when I check one of the practioners, but as soon as I more than one, the report wouldn't run. 当我运行报告时,当我检查其中一个实践者时,definitley可以正常工作,但是如果我不止一个,则该报告将不会运行。 It does not return any error, but just the header shows, which I think means that no data is found. 它不返回任何错误,而仅显示标题,我认为这意味着未找到数据。

Experts, do you see where I've gone wrong with this? 专家,您看到我在哪里出错了吗?

Thanks 谢谢

If you're able to create UDFs, this link might be helpful. 如果您能够创建UDF,则此链接可能会有所帮助。 How do I split a string so I can access item x? 如何分割字符串以便可以访问项目x?

The parameter would be parsed in the SQL/function, and SSRS would simple pass the concatenated string. 该参数将在SQL /函数中解析,SSRS将简单地传递级联的字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM