Reporting services 使用URL将多个值传递给SSRS中的下拉参数

Reporting services 使用URL将多个值传递给SSRS中的下拉参数,reporting-services,Reporting Services,我正在尝试为ssrs中由“,”分隔的参数传递多个值。在存储过程中,使用where condition和split函数限制结果数据集,这将为我提供报告数据集的结果 WHERE YEAR(a.month_start_date)IN (SELECT Value FROM dbo.FnSplit(@year,',')) --AND datename(month,month_start_date) IN (SELECT Value FROM dbo.FnSplit(@month,',')) AND b1.

我正在尝试为ssrs中由“,”分隔的参数传递多个值。在存储过程中,使用where condition和split函数限制结果数据集,这将为我提供报告数据集的结果

WHERE YEAR(a.month_start_date)IN (SELECT Value FROM dbo.FnSplit(@year,','))
--AND datename(month,month_start_date) IN (SELECT Value FROM dbo.FnSplit(@month,','))
AND b1.branch_cd IN (SELECT Value FROM dbo.FnSplit(@branch,','))
我创建了一个数据集来获取年份过滤器的可用值

将参数配置为从我的筛选器数据集中获取可用值,并选中“允许多个值”选项

然后,我还将报表数据集限制为接受具有以下条件的参数

=Join(Parameters!year.Value,",")
我在url中传递值

http://<servername>/ReportServer/Pages/ReportViewer.aspx?<reportname>rs:Command=Render&year=2012,2013,2014
http:///ReportServer/Pages/ReportViewer.aspx?rs:Command=Render&year=2012,2013,2014
我的筛选器不选择通过url传递的值。该报告仅显示下拉列表中的值列表,但未选择通过url解析的值

我不确定我是否还遗漏了什么。请建议


谢谢

这里的问题是您的URL构造不正确。你试图把这些年作为一个单一的参数来处理,但这不是它的工作原理。将其作为一堆参数传递,然后让报表服务器将其放在一起,并将其放入SQL

您的URL应该如下所示(我将:更改为%3a并分解了年份参数)

http:///ReportServer/Pages/ReportViewer.aspx?rs%3aCommand=Render&year=2012&year=2013&year=2014
我希望这能帮助别人

http://<servername>/ReportServer/Pages/ReportViewer.aspx?<reportname>rs:Command=Render&year=2012,2013,2014
http://<servername>/ReportServer/Pages/ReportViewer.aspx?<reportname>rs%3aCommand=Render&year=2012&year=2013&year=2014