Call an SSRS report from code and pass in the parameters

This article will show how to call an SSRS report from code and pass in the parameters

The task here is to form the URL correctly, we're not going to cover how to open the browser, we have that in different articles for VBA and .NET

Form the url like this:

http://SERVERNAME/ReportServer/Pages/ReportViewer.aspx?/FOLDERNAME/REPORTNAME&PARAMNAME=PARAMVALUE

I apologize for all the <tags> in that string. This is how it looks with the values substituted in:

http://vmgp11/ReportServer/Pages/ReportViewer.aspx?/RMADetailsReport/RMADetailsReport&RETURNDOCID=RMA000000003007&Return_Record_Type=1

Note that we're going to 'ReportServer' and not 'Reports', that suprised me. Also, the report folder and report name seem odd to me, but it works. The parameters are just added to the end in name/value pairs, separated by ampersands:

&ParamName=ParmValue

Call the whole thing like this:

System.Diagnostics.Process.Start(strUrl)

 


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences