Parameters in Report URL
November 4, 2011 Leave a comment
A colleague asked me if it’s possible to set the parameters of a Report in the URL, so that he could send it to an end-user. I didn’t know the answer, and after some research I came to the conclusion that it’s possible.
Just like your used to, you pass parameters into the Report by modifying the URL. An example of a normal Report URL looks like this:
In order to use parameters in the URL, you need to use the Service URL. The Service URL has the possibility to add specific options into the URL, so that SSRS knows what to execute. The changed URL looks like this:
See Reports directory:
List Reports in SSRS directory:
As you can see, the SSRS contains a folder called “Area 51”, and a subfolder “Finance”. This folder contains the Report “CustomerReport”, which we want to use to pass parameters.
Parameters in an URL are added as followed:
Just a CustomerID:
And CustomerID and PaymentDate:
The “rs:” parameter tells the SSRS what to do with the URL. “ListChildren” will create an open-dir look and feel, and “Command=Render” will actually execute and render the Report.
There are a lot more properties that you can use to modify the URL, and give the end-user a Report with specific data, without storing default values in the Report itself.