可以给您提供的思路:
1. 将每个报表批量导出为Excel 文件之后导出Excel文件代码如下,或参考博客: http://blog.gcpowertools.com.cn/post/2016/07/29/exportreport.aspx
- //System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"D:\Demo");
- //outputDirectory.Create();
- //GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings excelSetting = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings();
- //excelSetting.FileFormat = GrapeCity.ActiveReports.Export.Excel.Page.FileFormat.Xls;
- //excelSetting.OpenXmlStandard = GrapeCity.ActiveReports.Export.Excel.Page.OpenXmlStandard.Transitional;
- //excelSetting.Pagination = true;
- //excelSetting.MultiSheet = true;
- //GrapeCity.ActiveReports.Extensibility.Rendering.ISettings setting = excelSetting;
- //GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension excelRenderingExtension = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension();
- //GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outprovider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileName("outputDirectory.Name"));
- //reportDocument.Render(excelRenderingExtension, outprovider, excelSetting.GetSettings());
- GrapeCity.ActiveReports.Export.Excel.Section.XlsExport xlsExport1 = new GrapeCity.ActiveReports.Export.Excel.Section.XlsExport();
- xlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx;
- xlsExport1.Export(reportDocument, @"D:\Demo\"+"\\XLSExpt.xlsx");
复制代码
2. 再调用C#代码提供的拼接多个Excel文件的方法。
在网上搜了一些拼接Excel文件的方法,供您参考: http://stackoverflow.com/questio ... a-single-excel-file
|