本帖最后由 Felix.Li 于 2023-8-30 16:13 编辑
如何直接进预览页面
var designerOptions = GrapeCity.ActiveReports.WebDesigner.createDesignerOptions();
designerOptions.server.url = 'api';
designerOptions.language = "zh";
designerOptions.locale = "zh";
designerOptions.units = 'cm';
designerOptions.fileView.visible = false;
designerOptions.storeUnsavedReport = false;
designerOptions.reportInfo = { id: '@reportId' };
designerOptions.saveButton.visible = @showSave;
var viewer = null;
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: 'api/reporting',
},
displayMode: 'Continuous',
renderFormat: 'html',
reportID: options.reportInfo.id,
settings: {
zoomType: 'FitPage'
},
documentLoaded: function () {
$("#ar-web-designer-viewer-container .gc-toolbar__content").append($("#btns"));
$("#btns").show();
}
});
};
designerOptions.dataTab.dataSets.canModify = true;
designerOptions.dataTab.dataSources.canModify = true;
GrapeCity.ActiveReports.WebDesigner.renderApplication("ar-web-designer", designerOptions).then(res => {
$("#appbar_ar-web-designer_main-app-bar_main_Item_9 .gc-btn").trigger("click");
}).catch((error) => {
console.log(error);
});
|