0
votes

I am trying to pass multiple values for a parameter in ssrs which is delimited by ','.Limiting the result data set using where condition using split function in stored proc, this gives me results of my report data set

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,','))

I created a data set to get available values for year filter

Configured the parameter to get available values from my filter data set and also checked option to "Allow multiple values"

Select distinct year(month_start_date) as Year
From [DB].[dbo].[table]

Then I also limited my report data set to accept parameters with following condition.I configured parameter to accept the following value

=Join(Parameters!year.Value,",")

I pass in values in url

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

My filter does not select the values passed thru the url. The report only shows me the list of values in drop down but does not select the values parsed thru url

I am not sure if I am missing anything else. Please suggest.

Thanks!

1

1 Answers

1
votes

The issue here is that your URL is constructed incorrectly. You are trying to pass througth the years as a single parameter and that isn't how it works. Pass it through as a whole heap of parameters and then let the reporting server put it together and put it into the SQL.

Your URL should look like this (I changed the : to %3a and broke up the year parameter)

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

I hope this helps someone out.