找回密码
 立即注册

QQ登录

只需一步,快速开始

Crystal.Li 讲师达人认证 悬赏达人认证
论坛元老   /  发表于:2021-5-13 12:08  /   查看:2223  /  回复:0
本帖最后由 Crystal.Li 于 2021-5-13 12:09 编辑

这篇文章给大家提供一个基于Vue框架集成使用AR JS的demo,以便大家参考使用。
关键方法代码:

mounted: function() {
    designer = new ReportDesigner("#designer-host", { language: "zh" });
    designer.setActionHandlers({
        onRender: async (report)=>{
            this.designerHidden = true;
            this.$refs.reportViewer.Viewer().open(report.definition);
        },
        onCreate: () => {
            const reportId = `NewReport${this.counter + 1}`;
            //默认新建页面报表,指定templates.FPL
            return Promise.resolve({ definition: templates.FPL, id: reportId, displayName: reportId });
        },
        onSave: (info)=>{
            console.log(info);
            const reportId = info.id || `NewReport${this.counter + 1}`;
            //获取报表文件并下载
            const fileName = `NewReport${this.counter + 1}.rdlx-json`;
            const blob = new Blob([JSON.stringify(info.definition)],{type:"application/json"})
            this.download(fileName, blob);
            this.counter++;
            return Promise.resolve({displayName: reportId});
        }
    });
    //初始渲染test.rdlx-json报表
    designer.setReport({ id: "test.rdlx-json" });
}





本帖子中包含更多资源

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

x

0 个回复

您需要登录后才可以回帖 登录 | 立即注册
返回顶部