找回密码
 立即注册

QQ登录

只需一步,快速开始

wy89757

注册会员

3

主题

6

帖子

45

积分

注册会员

积分
45
最新发帖
wy89757
注册会员   /  发表于:2020-5-19 10:38  /   查看:2740  /  回复:1
之前客户使用的是AR12,现在想要在之前的基础上加功能,出PDF,有没有sample代码,万分感谢!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

1 个回复

倒序浏览
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2020-5-19 13:52:35
沙发
您好,导出PDF的参考:https://www.grapecity.com/activereports/docs/v14/online/overview.html
  1. // Provide the page report you want to render.
  2. System.IO.FileInfo rptPath = new System.IO.FileInfo(@"..\..\PageReport1.rdlx");
  3. GrapeCity.ActiveReports.PageReport pageReport = new GrapeCity.ActiveReports.PageReport(rptPath);

  4. // Create an output directory.
  5. System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyPDF");
  6. outputDirectory.Create();

  7. // Provide settings for your rendering output.
  8. GrapeCity.ActiveReports.Export.Pdf.Page.Settings pdfSetting = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();

  9. // Set the rendering extension and render the report.
  10. GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension pdfRenderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
  11. GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));
  12.             
  13. // Overwrite output file if it already exists
  14. outputProvider.OverwriteOutputFile = true;

  15. pageReport.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);
复制代码



回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部