How can I pass a parameter from ASP.NET to an SSRS report?

I need to pass a value as a parameter from an ASP.Net application to an SSRS report. How can i do this? Can anybody help me?

Thanks in advance.

+7
c # reportingservices-2005
source share
2 answers

Follow the next line and try ...

ReportViewer1.ServerReport.ReportServerUrl = new System.Uri("http://MyPC/reportserver"); ReportViewer1.ServerReport.ReportPath = "/ReportFolder/Reportname"; Microsoft.Reporting.WebForms.ReportParameter[] Param = new Microsoft.Reporting.WebForms.ReportParameter[3]; Param(2) = new Microsoft.Reporting.WebForms.ReportParameter("SDATE", "02/02/2002"); Param(1) = new Microsoft.Reporting.WebForms.ReportParameter("EDATE", "09/06/2000"); Param(0) = new Microsoft.Reporting.WebForms.ReportParameter("TASK", 0); View.ReportViewer.ShowParameterPrompts = false; View.ReportViewer.ServerReport.SetParameters(Param); View.ReportViewer.ServerReport.Refresh(); 
+6
source share

You can pass parameter values ​​in the URL used to receive the report.

In addition, you must disable the "custom query (for parameters)" in /reports/Pages/Folder.aspx for your report.

Example of setting a parameter called ParameterName : /Reports/Pages/Report.aspx?...&ParameterName=ParameterValue

View reports using a browser

+2
source share

All Articles