Passing Parameters in URL to view a SSRS Report
September 26, 2008
I was having issues with passing parameters to SSRS and here is what I learnt.
I hope this helps some one else and saves some time.
Important thing to note here is SSRS has two Report Application Pools
and two report virtual sites (Check Under Default website in Server you will find Reports and ReportServer sites)
-Reports is the portal (Report Manager). -ReportServer is the asp.net application that is Reporting Services.
Reports
When we use Reports the report comes up in SSRS page but no parameters are passed in.
e.g. http://Server/Reports/Pages/Report.aspx?ItemPath=%2fReports%2fPrint+Full+USER+Report
Reports Server
Next, when you do this with the Report Server, the report opens up. Note: Parameter is case sensitive to the way it is in the report
e.g. http://Server/ReportServer/?%2fReports%2fPrint+Full+ USR+Report
&rs:Command=Render&UsrID=12345&rc:Parameters=false&rc:Toolbar=false
Example 1 Report : ErrorStatistics Report Parameters: DateFrom, DateTo, SubmissionID, InsCode Case 1 : No Parameters passed : User needs to enter http://Server/ReportServer/?%2fReports%2fErrorStatistics Note: In Server we have ErrorStatistics Report in the Reports folder which is denoted by %2fReports%2f Case 2 : With parameters Passed via URL aspx direct all http://Server/ReportServer/?%2fReports%2fErrorStatistics&rs:Command=Render& DateFrom=08/20/2008&DateTo=09/20/2008&SubmissionID=&InsurerCode= Case 3 : With parameters Hidden http://Server/ReportServer/?%2fReports%2fErrorStatistics &rs:Command=Render&DateFrom=08/20/2008 &DateTo=09/20/2008&SubmissionID=&InsurerCode=&rc:Parameters=false Case 4 : With parameters Hidden and No tool bar http://Server/ReportServer/?%2fReports%2fErrorStatistics&rs:Command=Render&DateFrom=08/20/2008 &DateTo=09/20/2008&SubmissionID=&InsurerCode= &rc:Parameters=false&rc:Toolbar=false Case 5 : Direct Open Report in PDF http://Server/ReportServer/?%2fReports%2fErrorStatistics&rs:Command=Render&DateFrom=08/20/2008& DateTo=09/20/2008&SubmissionID=&InsurerCode= &rc:Parameters=false&rc:Toolbar=false&rs:Format=PDF Case 6 : Direct Open Report in Excel http://Server/ReportServer/?%2fReports%2fErrorStatistics&rs:Command=Render&DateFrom= 08/20/2008&DateTo=09/20/2008&SubmissionID= &InsurerCode=&rc:Parameters=false&rc:Toolbar=false&rs:Format=Excel Example 2 Report : Print Full USER Details Report Parameters: UserID http://Server/ReportServer/?%2fReports%2fPrint+Full+USR+Report&rs:Command=Render &UsrID=12345&rc:Parameters=false&rc:Toolbar=false References:
- http://www.crystalreportsbook.com/SSRSandCR_ParametersAndFormulas.asp
- http://msdn.microsoft.com/en-us/library/ms170246.aspx
- http://www.mssqltips.com/tip.asp?tip=1336
- http://dobrzanski.net/2008/08/11/reporting-services-problem-with-passing-parameters-directly-in-the-url/
- http://technet.microsoft.com/en-us/library/bb522754.aspx