您好,
经过调查后发现,在设置MultiSheet和Pagination,这两个参数后,系统会将每页的记录取出来,然后计算去掉头,再放进一页当中。
我这边的现象是计算机会卡死,不能导出数据。
由于计算量很大,所有暂时没有好的办法。
但是,我这边可以提供一个替代的方案。使用服务器端的代码进行导出,按照无格式的数据导出。
- protected void Button2_Click(object sender, EventArgs e)
- {
- string report = "RPT004";
- // Provide the page report you want to render.
- GrapeCity.ActiveReports.PageReport _reportDef = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath("/Reports/" + report + ".rdlx")));
- GrapeCity.ActiveReports.Document.PageDocument _reportRuntime = new GrapeCity.ActiveReports.Document.PageDocument(_reportDef);
- // Create an output directory
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
- // Provide settings for your rendering output.
- GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings
- excelSetting = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings();
- GrapeCity.ActiveReports.Extensibility.Rendering.ISettings setting = excelSetting;
- //Set the rendering extension and render the report.
- GrapeCity.ActiveReports.Export.Excel.Page.ExcelTransformationDevice
- excelRenderingExtension = new
- GrapeCity.ActiveReports.Export.Excel.Page.ExcelTransformationDevice();
- GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider();
- _reportRuntime.Render(excelRenderingExtension, outputProvider, excelSetting.GetSettings());
- Response.ContentType = "application/vnd.ms-excel";
- Response.AddHeader("content-disposition", "inline;filename=MyExport.xls");
- outputProvider.GetPrimaryStream().OpenStream().CopyTo(ms);
- Response.BinaryWrite(ms.ToArray());
- Response.End();
- }
复制代码
|