ahjuxin.net 发表于 2022-9-30 14:42:22

ActiveReports设计器嵌入现有项目

项目为前端:vue,后端java;现在部署了一台ActiveReports web设计器,想要在项目中调用这个设计器(参考之前view的经验,应该是直接在前端调用的),实现报表的设计和修改;这个调用的语法怎么写

Felix.Li 发表于 2022-9-30 14:42:23

ahjuxin.net 发表于 2022-10-26 15:51
你这个demo是不是给错了,里面没有对应的方法

抱歉啊老哥,删多了0......



James.Lv 发表于 2022-9-30 15:00:23

您好,您可以直接用我们AR开发一个web工程,部署成一个单独的服务,然后在您自己项目里面要使用的话,直接iframe集成URL就可以

wengMQ 发表于 2022-9-30 15:21:07

第一步:https://github.com/activereports/WebSamples16/tree/main/WebDesignerSamples/WebDesigner_MVC_Core 设置成允许跨域;
// Configure CORS
            app.UseCors(cors => cors.SetIsOriginAllowed(origin => true)
                .AllowAnyMethod().AllowAnyHeader().AllowCredentials().WithExposedHeaders("content-disposition"));

wengMQ 发表于 2022-9-30 15:22:48

第二步:在项目中引入jsViewer和web-designer的css和js文件

wengMQ 发表于 2022-9-30 15:24:24

第三步:修改设计器的服务api;designerOptions.server.url = "http://localhost:58721/api/";

wengMQ 发表于 2022-9-30 15:25:32

第四步:修改预览jsview;
designerOptions.openViewer = function (options) {
                        if (viewer) {
                            viewer.openReport(options.reportInfo.id);
                            return;
                        }
                        viewer = GrapeCity.ActiveReports.JSViewer.create({
                            locale: options.locale,
                            element: '#' + options.element,
                            reportService: {
                              url: "http://localhost:58721/api/" +'reporting',
                            },
                            reportID: options.reportInfo.id,
                            settings: {
                              zoomType: 'FitPage'
                            },
                        });
                  };

Bella.Yuan 发表于 2022-9-30 16:19:23

wengMQ 发表于 2022-9-30 15:25
第四步:修改预览jsview;
designerOptions.openViewer = function (options) {
                        ...

感谢大佬帮忙回复,很给力~

ahjuxin.net 发表于 2022-10-8 09:12:13

wengMQ 发表于 2022-9-30 15:25
第四步:修改预览jsview;
designerOptions.openViewer = function (options) {
                        ...

https://gcdn.grapecity.com.cn/showtopic-141465-1-1.html我看这个专题介绍写的,但是打开会报错:web-designer.js:2 Fetch API cannot load file:///E:/api/themes/list. URL scheme "file" is not supported.
(anonymous) @ web-designer.js:2;你这块提到的修改预览jsview,那么这个文件是在哪呢?我没有这个文件

Felix.Li 发表于 2022-10-8 09:50:39

ahjuxin.net 发表于 2022-10-8 09:12
https://gcdn.grapecity.com.cn/showtopic-141465-1-1.html我看这个专题介绍写的,但是打开会报错:web-d ...

关于第一个问题不太确定是不是代码哪里写了什么,cannot load file:///E:/api/themes/list   这里可否贴一些具体代码或者截图呢,
然后第二个说的jsViewer是在相应的html文件里面就可以了,这里说的修改jsViewer是在设计器集成好之后,打开Viewer,按照上述的写法,可以直接在设计器点击预览打开

然后项目可以参考我们给出的示例项目,您可以直接在git上参考:https://github.com/activereports/WebSamples16
页: [1] 2 3 4 5
查看完整版本: ActiveReports设计器嵌入现有项目