ActiveReports设计器嵌入现有项目
项目为前端:vue,后端java;现在部署了一台ActiveReports web设计器,想要在项目中调用这个设计器(参考之前view的经验,应该是直接在前端调用的),实现报表的设计和修改;这个调用的语法怎么写ahjuxin.net 发表于 2022-10-26 15:51
你这个demo是不是给错了,里面没有对应的方法
抱歉啊老哥,删多了0......
您好,您可以直接用我们AR开发一个web工程,部署成一个单独的服务,然后在您自己项目里面要使用的话,直接iframe集成URL就可以
第一步: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")); 第二步:在项目中引入jsViewer和web-designer的css和js文件 第三步:修改设计器的服务api;designerOptions.server.url = "http://localhost:58721/api/"; 第四步:修改预览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'
},
});
}; wengMQ 发表于 2022-9-30 15:25
第四步:修改预览jsview;
designerOptions.openViewer = function (options) {
...
感谢大佬帮忙回复,很给力~ 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,那么这个文件是在哪呢?我没有这个文件
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