Guest User

Untitled

a guest
Jan 21st, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. var reportForm = new ReportViewerForm(); // instantiate the form
  2. // load the report definition into the viewer:
  3. reportForm.reportViewer1.LocalReport.ReportEmbeddedResource = "Namespace.Report.rdlc";
  4.  
  5. // loading the data works great with a DataSet:
  6. var data = _reportingDataSet.Tables[0];
  7. // create the ReportDataSource with the report data:
  8. var reportDataSource = new ReportDataSource("rdsReportDataSource", data);
  9.  
  10. reportForm.ShowReport(new[] { reportDataSource });
  11.  
  12. public void ShowReport(IEnumerable<ReportDataSource> dataSources)
  13. {
  14. foreach (var dataSource in dataSources) reportViewer1.LocalReport.DataSources.Add(dataSource);
  15. reportViewer1.RefreshReport();
  16. }
  17.  
  18. this.reportViewer1.LocalReport.ReportPath = @"Add absolute path of rdlc file"//e.g. @"C:SomeReport.rdlc" ;
  19. this.reportViewer1.RefreshReport();
  20.  
  21. this.reportViewer1.LocalReport.DataSources.Add(MyreportDataSource);
Add Comment
Please, Sign In to add comment