using Microsoft.Reporting.WinForms; using System.IO; using System.Data; public byte[] RenderReport(string reportPath, DataTable data)
var report = new LocalReport(); report.ReportPath = reportPath; report.DataSources.Add(new ReportDataSource("DataSet1", data)); reportviewer 2015
string mimeType, encoding, fileNameExtension; string[] streams; Warning[] warnings; using Microsoft
<dependentAssembly> <assemblyIdentity name="Microsoft.ReportViewer.Common" publicKeyToken="89845dcd8080cc91" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.ReportViewer.WinForms" publicKeyToken="89845dcd8080cc91" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" /> </dependentAssembly> Here is a minimal WinForms example that loads an RDLC file and renders it to PDF without showing the UI. public byte[] RenderReport(string reportPath