您好,您可以参考这个实现:
https://demo.grapecity.com.cn/ac ... s/api/export/purejs
基本代码如下:
- import { Core,PdfExport } from "@grapecity/activereports";
- const pageReport = new Core.PageReport();
- let mainReport = "report.rdlx-json"
- await pageReport.load(mainReport);
- const pageDocument = await pageReport.run();
- console.log('page report randered completed, start export the PDF');
- const result = await PdfExport.exportDocument(pageDocument, settings, pageNum => {
- console.log(`exporting PDF version at page ${pageNum}`);
- });
复制代码 返回的result.data就是pdf流 result.download() 就会直接下载PDF
|