디자이너 컴포넌트 - 마스터 보고서

이 샘플은 마스터 보고서 기능이 실제로 작동하는 모습을 보여줍니다.페이지 헤더와 테이블 위에 두 개의 컨텐츠 자리 표시자가 포함된 마스터 보고서로부터 생성된 콘텐츠 보고서를 확인할 수 있습니다. 자리 표시자에 새 항목을 추가할 수는 있지만, 잠긴 콘텐츠(헤더, 로고, 테이블)는 수정할 수 없습니다.

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>ActiveReportsJS Report Designer Report Master Report Sample</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <script defer src="/activereportsjs/demos/arjs/dist/ar-js-core.js"></script> <script defer src="/activereportsjs/demos/arjs/dist/ar-js-designer.js"></script> <script defer src="/activereportsjs/demos/arjs/dist/ar-js-viewer.js"></script> <script defer src="/activereportsjs/demos/arjs/dist/ar-js-pdf.js"></script> <script defer src="/activereportsjs/demos/arjs/dist/ar-js-tabular-data.js"></script> <script defer src="/activereportsjs/demos/arjs/dist/ar-js-html.js"></script> <script defer src="$DEMOROOT$/lib/purejs/license.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous" /> <link rel="stylesheet" type="text/css" href="/activereportsjs/demos/arjs/styles/ar-js-ui.css" /> <link rel="stylesheet" type="text/css" href="/activereportsjs/demos/arjs/styles/ar-js-viewer.css" /> <link rel="stylesheet" type="text/css" href="/activereportsjs/demos/arjs/styles/ar-js-designer.css" /> <style> #designer-host, #viewer-host { margin: 0 auto; width: 100%; height: 500px; } .hide { display: none; } </style> </head> <body onload="onInit()"> <div id="designer-toolbar" class="container-fluid"> <div class="row mt-3 mb-3"> <button id="btnDesignerOpen" type="button" class="btn btn-outline-primary btn-sm col-sm-2 ml-1 hide" onclick="onOpenDesigner()" > Open Designer </button> </div> </div> <div id="designer-host"></div> <div id="viewer-host" class="hide"></div> <script> function setVisibility(selector, isVisible) { document.querySelectorAll(selector).forEach(function (element) { isVisible ? element.classList.remove("hide") : element.classList.add("hide"); }); } function onOpenDesigner() { setVisibility("#viewer-host, #btnDesignerOpen", false); setVisibility("#designer-host, #btnPdfPreview", true); } function onInit(){ MESCIUS.ActiveReportsJS.Core.FontStore.registerFonts( "/activereportsjs/demos/resource/fontsConfig.json" ); var designer = new MESCIUS.ActiveReportsJS.ReportDesigner.Designer( "#designer-host" ); designer.setActionHandlers({ onRender: (report) => { setVisibility("#viewer-host, #btnDesignerOpen", true); setVisibility("#designer-host, #btnPdfPreview", false); viewer.open(report.definition); return Promise.resolve(); }, }); designer.createReport({ "reportType" : "CPL", "masterReportId": "reports/MasterReport.rdlx-json" }) var viewer = new MESCIUS.ActiveReportsJS.ReportViewer.Viewer( "#viewer-host" ); } </script> </body> </html>