Last post Jun 18, 2013 07:47 PM by N_EvilScott
Jan 06, 2013 03:51 AM|AnandSG|LINK
I am generating the pdf file out this code using 2 datatables of dataset, but, the data in pdf appearing from ds.Tables only , not of ds.Tables.my code is as below . Kindly suggest solution...
ReportViewer viewer = new ReportViewer();
viewer.ProcessingMode = ProcessingMode.Local;
viewer.LocalReport.ReportEmbeddedResource = @"D:\Projects\NIKHIL\NIKHIL\Report3.rdlc; viewer.LocalReport.ReportPath = @"D:\Projects\NIKHIL\NIKHIL\Report3.rdlc; viewer.LocalReport.DataSources.Clear();
viewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", ds.Tables)); viewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", ds.Tables)); viewer.LocalReport.Refresh();
byteViewer = viewer.LocalReport.Render(reportType, deviceInfo, out mimeType, out encoding, out extension, out streamIds, out warnings);
Jun 18, 2013 07:47 PM|N_EvilScott|LINK
It depends on where those data sources are used. If it's a single stand alone report and nothing fancy, then the way you are doing it is fine. If you have drill down reports, or sub reports in there, then you'll need to subscribe to those events using the
reportviewer, and supply the datasource at that point in order for it to render properly.