Click here to Skip to main content
15,878,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am trying to build a winform so that I can pass to it the parameters of any ssrs reports.
At present, I have one form which accepts two parameters to generate one specific ssrs report.
Can there be one form so that I can pass to it the parameters of any ssrs reports so that it generates the report.
This way, I do not have to have one winform for each ssrs report.
Any suggestions please?
Thanks
C#
this.reportViewer1.ServerReport.ReportServerUrl = new Uri(@"http://" + strMachineName + "/ReportServer");
this.reportViewer1.ServerReport.ReportPath = _strReportFolder + ReportName;

Microsoft.Reporting.WinForms.ReportParameter[] RptParameter = new Microsoft.Reporting.WinForms.ReportParameter[2];
RptParameter[0] = new Microsoft.Reporting.WinForms.ReportParameter("Parameter0", parameterValue0);
RptParameter[1] = new Microsoft.Reporting.WinForms.ReportParameter("Parameter1", parameterValue1);
                
this.reportViewer1.ServerReport.SetParameters(RptParameter);
this.reportViewer1.RefreshReport();
Posted
Updated 14-Dec-12 4:19am
v2
Comments
arkiboys 14-Dec-12 10:51am    
Hi, I do not see what you have posted.

1 solution

like the parameter , you can change the report name at run time to load different report in the same report viewer.

what you set here matters
C#
this.reportViewer1.ServerReport.ReportPath = _strReportFolder + ReportName;

dont forget to call
C#
this.reportViewer1.RefreshReport();
every time you change the report name and report parameter.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900