Monday, 11 January 2010

SSRS - passing multi value parameters via URL

Passing parameters from one report to another report via the URL can be a bit tricky, esepecially when it comes to multi value parameters. Below you will find an example of how to do this for single and multi value parameters.
For example, your report server is at http://myserver/reportserver and the report you want to pass the parameter(s) to is in \MyFolder\MyReport and the parameter name is myparam1.

If it is a single value parameter you will generate the URL as
=http://myserver/reportserver/Pages/ReportViewer.aspx?%2fMyFolder%2fMyReport&rs:Command=Render&myparam1=" & parameters!myparam.value

This is quite obvious and not too tricky but how would you pass multi value parameters? Some people have tried to do it like this:
=http://myserver/reportserver/Pages/ReportViewer.aspx?%2fMyFolder%2fMyReport&rs:Command=Render&myparam1=" & Join(parameters!myparam.value,",")

Unfortunately this won't work, the correct method is:
=http://myserver/reportserver/Pages/ReportViewer.aspx?%2fMyFolder%2fMyReport&rs:Command=Render&myparam1=" & Join(parameters!myparam.value,"&myparam=,")

In other words, for every value of the parameter you have to pass &myparam=value to the URL.

For more info on URL access click