Me Without You … Passing SSRS Report Parameters through a URL

Me without you is like a Report without Report Parameters …. 🙂

This post discusses how to pass parameters into a Sharepoint Reporting Services report through a formatted URL.  The following url example http://myspsite/subsite/_vti_bin/reportserver?http://myspsite/subsite/AdventureWorks/Employee_Sales_Summary.rdl&ReportMonth=3&ReportYear=2008 passes two parameters (ReportMonth and ReportYear) to a report (Employee_Sales_Summary.rdl).  We will break this example down using the url constructs.

This is the general formula …

rswebserviceurl
            ?reportpath
            [&prefix:param=value]…n]

And these are the components of the URL example broken down into digestable chunks …

Report Web Service URL (http://myspsite/subsite/_vti_bin/reportserver) – This is the URL of the Report Server (effectively the Sharepoint server)
Report Path (http://myspsite/subsite/AdventureWorks/Employee_Sales_Summary.rdl) – Passes the fully qualified URL of the location of the Reporting Services report in the Sharepoint document library
First Parameter (ReportMonth=3) – Passes the value 3 into Report parameter “ReportMonth”.  If for example the report is designed to accept a null for this parameter you would format this as ReportMonth=:isnull=true
Second Parameter (ReportYear=2008) – Passes the value 2008 into Report parameter “ReportYear”

If your parameters or dates, the approach is similar, however express your parameter value in the format mm/dd/yyyy for a date, and for a string just type in the value like you would a number.  For multi value parameters there is a good example here http://altecnotes.blogspot.com.au/2012/05/pass-multi-value-parameter-to-ssrs.html.

The following link goes through the basics…

http://msdn.microsoft.com/en-us/library/ms155391.aspx

And you can use the URL api to do a heap of other cool things, like export the report to a file without opening the report in the browser…

http://technet.microsoft.com/en-us/library/6a3b7fc3-3d91-4d12-8371-42ea12e74517 – e.g. The URL example http://myspsite/subsite/_vti_bin/reportserver?http://myspsite/subsite/myreport.rdl&rs:Format=PDF shows how to export the report myrereport.rdl to PDF.

Read more about other url functions here…

http://technet.microsoft.com/en-us/library/ms153586

About AussieBICG

Connect with me here https://au.linkedin.com/in/aussiebicg

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s