您可以参考这个链接:
https://www.grapecity.com.cn/blogs/exportreport
或者参考如下代码:
- GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(@"demo无参数.rdlx"));
- GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(report);
- System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"D:\AR\export\MyExcel");
- outputDirectory.Create();
- GrapeCity.ActiveReports.Export.Pdf.Page.Settings pdfSetting = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();
- GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension pdfRenderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
- GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension("这里定义文件名字"));
- outputProvider.OverwriteOutputFile = true;
- report.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);
复制代码
|