1金币
AR16 web设计器如何使用JS在打开的时候自动加载地址栏的传递的报表。
之前AR15可以通过reportInfo传递报表名称加载,AR16好像变了,没有reportInfo对象。
var designerOptions = GrapeCity.ActiveReports.WebDesigner.createDesignerOptions();
designerOptions.server.url = 'api';
designerOptions.reportInfo ='报表名称';
AR16的index.cshtml文件
- <script>
- var viewer = null;
- var designer = GrapeCity.ActiveReports.Designer.create('#ar-web-designer', {
- rpx: { enabled: true },
- appBar: { openButton: { visible: true } },
- documents: { fileView: { visible: @(Context.Request.Query["fileView"].Equals("true").ToString().ToLower()) } },
- data: { dataSets: { canModify: true }, dataSources: { canModify: true } },
- preview: {
- openViewer: (options) => {
- console.log(options);
- if (viewer) {
- viewer.openReport(options.documentInfo.id);
- return;
- }
- viewer = GrapeCity.ActiveReports.JSViewer.create({
- element: '#' + options.element,
- renderFormat: 'svg',
- reportService: {
- url: 'api/reporting',
- },
- reportID: options.documentInfo.id,
- settings: {
- zoomType: 'FitPage',
- },
- });
- }
- }
- });
- </script>
复制代码
|
|