Search code examples
urlreporting-servicesparametersreporting

Passing a parameter via URL to SQL Server Reporting Services


I'm trying to pass a userId (string) in the URL which will be passed to the database and used by a query in SSRS.

base URL:

http://blah/Reports/Pages/Report.aspx?ItemPath=MyReport

I tried this, but it doesn't work:

http://blah/Reports/Pages/Report.aspx?ItemPath=MyReport&UserId=fred

Any ideas?


Solution

  • As well as what Shiraz said, try something like this:

    http://<server>/ReportServer/Pages/ReportViewer.aspx?%2f<path>%2f<ReportName>&rs:Command=Render&UserID='fred'
    

    Note the path would only work if you are in a single folder. When I have to do this I simply browse to the report using the reportserver path ("reports" is the report manager) and copy the url then add &<ParameterName>=<value> to the end.