我正在使用数据集的 2 个数据表生成 pdf 文件,但是,pdf 中的数据仅来自 ds.Tables[0],而不是 ds.Tables[1]。请建议解决方案..我的代码如下..
ReportViewer viewer = new ReportViewer();
viewer.ProcessingMode = ProcessingMode.Local;
viewer.Reset();
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[0]));
viewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", ds.Tables[1]));
viewer.LocalReport.Refresh();
byteViewer = viewer.LocalReport.Render(reportType, deviceInfo, out mimeType, out encoding, out extension, out streamIds, out warnings);
byte[] file = byteViewer;
FileStream stream = new FileStream(FileStorageLocation + "\\" + fileName, FileMode.Create, FileAccess.Write);
stream.Write(file, 0, file.Length);
stream.Close();