SHARE
TWEET

Untitled

a guest Jan 21st, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top