ReportService obj = new ReportService();
dataTableList2 = dataTableList;
GrapeCity.ActiveReports.PageReport _reportDef = obj.GetPageReport(dic["rdlx"]);
GrapeCity.ActiveReports.Document.PageDocument _reportRuntime =
new GrapeCity.ActiveReports.Document.PageDocument(_reportDef);
System.IO.MemoryStream ms = new System.IO.MemoryStream();
_reportRuntime.LocateDataSource += _reportRuntime_LocateDataSource;
// Provide settings for your rendering output.
GrapeCity.ActiveReports.Export.Pdf.Page.Settings pdfSetting = new
GrapeCity.ActiveReports.Export.Pdf.Page.Settings();
GrapeCity.ActiveReports.Extensibility.Rendering.ISettings setting = pdfSetting;
pdfSetting.PrintOnOpen = true;
//Set the rendering extension and render the report.
GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension pdfRenderingExtension =
new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider outputProvider =
new GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider();
_reportRuntime.Render(pdfRenderingExtension, outputProvider, pdfSetting);
outputProvider.GetPrimaryStream().OpenStream().CopyTo(ms);
return ms;
如果数据量比较大,PDF的文档就会特别慢 ,1万多条大约3分钟左右。 |