Click here to Skip to main content
12,622,913 members (30,177 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# C#4.0
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
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 14-Dec-12 4:40am
arkiboys2.7K
Updated 14-Dec-12 5:19am
v2
Comments
arkiboys 14-Dec-12 10:51am
   
Hi, I do not see what you have posted.

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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
this.reportViewer1.ServerReport.ReportPath = _strReportFolder + ReportName;
dont forget to call
this.reportViewer1.RefreshReport();
every time you change the report name and report parameter.
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.161128.1 | Last Updated 14 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100