How to add parameters to the SSRS report and parameters to the ssrs report
How to add parameters to an SSRS report
A problem occurs after the connection.The report is refreshed constantly after parameters are added to the report, which is the same as the refresh of the report. Then let's solve it.
1.
This is to add default parameters to the report and refresh continuously after entering the page.
ReportParameter para = new ReportParameter ("ReportParameter1", "1"); // parameter ReportViewer1.ServerReport. reportServerCredentials = new MyReportServerCredentials (); ReportViewer1.ServerReport. reportServerUrl = new Uri ("http: // Report Server address/reportserver"); ReportViewer1.ServerReport. reportPath = "/report name"; ReportViewer1.ServerReport. setParameters (new ReportParameter [] {para}); // input parameters
After this code is added to Page_Load, the problem may occur .. Loading is always displayed. It looks like a refresh.
Solution
if (!IsPostBack){
ReportParameter para = new ReportParameter ("ReportParameter1", "1"); // parameter ReportViewer1.ServerReport. reportServerCredentials = new MyReportServerCredentials (); ReportViewer1.ServerReport. reportServerUrl = new Uri ("http: // Report Server address/reportserver"); ReportViewer1.ServerReport. reportPath = "/report name"; ReportViewer1.ServerReport. setParameters (new ReportParameter [] {para}); // input parameters
}
In this way, the report is loaded by default.
Succeeded. The following is a concentrated report.