maxiuxiu 发表于 2021-2-19 11:01:12

模板文件JSON数据如何输出成实体文件,或者直接通过模板文件JSON数据执行打印

这是模板文件的JSON数据,请问,如何将这个json数据转成实体文件,或者 直接通过这个json数据与打印数据结合向打印机输出打印

Lenka.Guo 发表于 2021-2-19 11:36:24

您好

这是通过报表设计器生成的报表格式的JSON 文件,可以另存为后缀为.rdlx-json, 再次用设计器打开,或者直接使用viewer.open(JSON) 即可打开报表文件。
如果您需要修改报表文件传递的JSON 数据,可参考示例:https://demo.grapecity.com.cn/activereportsjs/demos/features/viewer-runtime-data-binding/purejs

maxiuxiu 发表于 2021-2-19 11:41:37

Lenka.Guo 发表于 2021-2-19 11:36
您好

这是通过报表设计器生成的报表格式的JSON 文件,可以另存为后缀为.rdlx-json, 再次用设计器打开, ...

我是想程序直接拿着这个 json数据做打印操作

Lenka.Guo 发表于 2021-2-19 13:39:20

打印报表调用PageReport.print() 方法,具体使用参考文档:https://demo.grapecity.com.cn/activereportsjs/docs/DeveloperGuide/ActiveReportsJSViewer/Print
import { Core } from "@grapecity/activereports";
const report = new Core.PageReport();
await report.load("/reports/text-only.rdlx-json");
const doc = await report.run();
doc.print();

maxiuxiu 发表于 2021-2-19 13:47:37

Lenka.Guo 发表于 2021-2-19 13:39
打印报表调用PageReport.print() 方法,具体使用参考文档:https://demo.grapecity.com.cn/activereportsjs ...

不好意思 ,我们购买的是ActiveReports,应该不是 ActiveReportsJS

Lenka.Guo 发表于 2021-2-19 14:07:35

好的,JSON 报表格式是 ActiveReportsJS 对应的报表格式,而ActiveReports报表格式为对应的.rdlx。
打印方法参考:https://help.grapecity.com.cn/pages/viewpage.action?pageId=47648088
页: [1]
查看完整版本: 模板文件JSON数据如何输出成实体文件,或者直接通过模板文件JSON数据执行打印