Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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 3:40am
arkiboys2.6K
Edited 14-Dec-12 4:19am
v2
Comments
arkiboys at 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
0 Sergey Alexandrovich Kryukov 485
1 OriginalGriff 280
2 CPallini 230
3 BillWoodruff 230
4 ChauhanAjay 149
0 OriginalGriff 6,609
1 Sergey Alexandrovich Kryukov 6,240
2 CPallini 5,180
3 George Jonsson 3,574
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 14 Dec 2012
Copyright © CodeProject, 1999-2014
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