How to pass SSRS params into a URL

clip art of 
 a double-quote character

Question

I have Native SSRS configured on a 2012 instance (11.0.2100). I have two reports with images that act as buttons to toggle between the chart report and the detail report. I want to configure the action URLs to dynamically pass in parameters when switching between the reports, so that the defaults (derived from a query) are not used when switching views, the manually inputted params would persist.

I have tried the below versions of my URL and, in all cases, the default (query driven) parameters are used to run the report, not the passed in parameters.

  • http://internalreporting/ReportsManager/Pages/Report.aspx?ItemPath=%2fFinance%2fDischarge+Totals+By+Day+Less+New+Borns+-+Chart&rs:Command=Render&rs:StartDate=2015-10-01&rs:EndDate=2015-10-31
  • http://internalreporting/ReportsManager/Pages/Report.aspx?ItemPath=%2fFinance%2fDischarge+Totals+By+Day+Less+New+Borns+-+Chart&rs:Command=Render&StartDate=2015-10-01&EndDate=2015-10-31
  • http://internalreporting/ReportsManager/Pages/Report.aspx?ItemPath=%2fFinance%2fDischarge+Totals+By+Day+Less+New+Borns+-+Chart&StartDate=2015-10-01&EndDate=2015-10-31
  • http://internalreporting/ReportsManager/Pages/Report.aspx?ItemPath=%2fFinance%2fDischarge+Totals+By+Day+Less+New+Borns+-+Chart&StartDate=10/1/2015&EndDate=10/31/2015

Any ideas on where I’m formatting my URLs incorrectly?

asked 2015-11-10 by SQL Hammer


Answer

(I don’t have an SSRS server handy at the moment to test/confirm this, so I’m going a bit off-the-cuff here, and might not be 100% spot-on)

I’ve never had luck with using the ReportManager URLs when I want to pass in specific parameters. Try using the ReportServer URLs instead. The ReportManager URLs are intended to be interactive, user-controlled sessions; whereas ReportServer is specifically intended for programmatic access–and if you’re crafting dynamnic URL parameters, that aligns better with the ReportServer usage.

BOL gives this example format for passing dates using the ReportServer URLs:
http://myserver/ReportServer/Pages/ReportViewer.aspx?%2fProduct_and_Sales_Report_AdventureWorks&SellStartDate=7/1/2005

answered 2015-11-10 by Andy Mallon