您好
我们的导出有两种方法一种就是您现在用的这种:filters的方法还有一种是 Rendering的方法
第一种方法由于是最先出的一个导出的方法可能有一定的局限性,最后我们又升级了一种办法也就是Rendering
我用Rendering方法进行测试问题解决
把button1_Click(object sender, EventArgs e)的代码修改为下面的代码:
- System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"D:\MyExcel");
- outputDirectory.Create();
- // Provide settings for your rendering output.
- GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings excelSetting = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings();
- excelSetting.FileFormat = GrapeCity.ActiveReports.Export.Excel.Page.FileFormat.Xls;
- 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 outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));
- outputProvider.OverwriteOutputFile = true;
- _document.Render(excelRenderingExtension, outputProvider, excelSetting.GetSettings());
复制代码
|