[{"id":"a0e184f5-60ef-4d4e-b394-f8f4edcec114","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"93511b60-fca4-41b8-b020-05e4164ce896","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"4d605a5e-03ea-465a-b508-46e0fdc00bb2","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"7f8bfa0e-4e84-42a7-b266-f57a0b76613d","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"1daa4a64-7a26-4dc4-997d-7a32f854e24e","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"1e8d2a58-6a92-44cd-859c-80fe3cf8b178","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"cefb7847-15cf-4a28-b387-a9f917df4ac2","tags":[{"product":null,"links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be","name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"363d0118-e051-4c0d-a8dc-b5accdc2bdd0","tags":[{"product":null,"links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be","name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"9af6025a-0aff-4f1c-96a1-ba5963a6e276","tags":[{"product":null,"links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be","name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"043663ed-1d7c-4ada-817f-e1fbbbcfd1b0","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"c650c110-7c1d-4741-9f66-2b17c24c246c","tags":[{"product":null,"links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be","name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"69ec27be-f154-48cd-9528-900e7213be7b","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"9add3481-4b5f-4dd1-8aa5-9ac0af2dc370","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"9afb798a-3f20-4119-986c-9f0784f7832e","tags":[{"product":null,"links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be","name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"8bcc63b0-d3af-4c7b-9c47-a10dbcf069b3","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"af01f907-2b5e-4d37-9762-da184cd81eab","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"5ca5da9d-8fd1-413b-8b1b-a96f170ab7a9","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"82a730d7-f274-4ed2-8ec6-9b8164e6d361","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"34858227-e4e3-46be-8c09-d86ce6655bde","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"e6490625-6787-4a30-a8bb-c6ea7823f52a","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"249eddd5-1fc3-4bbe-881a-01f4362136c4","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"cceb97e0-c2dc-408d-9ef7-855d239ff5a6","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"45a6742e-d26a-4493-b53a-73a4c56b9d7d","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"b8b1497d-23ad-432b-9dfa-04ea67781e23","tags":[{"product":null,"links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be","name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"e4ac0ae4-88c1-4f71-9a5d-d226e0a6ffd5","tags":[{"product":null,"links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be","name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"5ac1be92-f358-4867-a9ff-7c86977c19aa","tags":[{"product":null,"links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b","name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"21dd979a-80f7-4621-afa9-831a991d367d","tags":[{"product":null,"links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be","name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]},{"id":"fe1a54f1-ac2e-4f03-a87a-91cbf39c5a0f","tags":[{"product":null,"links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be","name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2"}]}]
ActiveReportsJS 보고서 디자이너에는 바로 사용 가능한 미리 보기 기능이 없어 호스팅 응용 프로그램의 코드를 설정해야 합니다. 이 페이지에서는 여러 가지 일반 시나리오에 대한 사용법을 제공합니다.
ActiveReportsJS 보고서 디자이너 컴포넌트에는 도구 모음에 미리 보기
버튼이 있습니다. 그러나 이 버튼은 사용하도록 설정되어 있지 않아 기본적으로 표시되지 않습니다. 이 버튼을 사용하도록 설정하려면 코드에서 디자이너 컴포넌트에 대해 onRender
작업 처리기를 구성해야 합니다. 자세한 내용은 작업 처리기 페이지를 확인하십시오. 사용자가 미리 보기
버튼을 클릭하면 ActiveReportsJS 디자이너가 onRender
처리기를 호출합니다. 디자이너가 첫 번째 인수에서 ID, 표시 이름 및 보고서 정의로 구성된 현재 표시된 보고서의 정보를 전달합니다. onRender
처리기는 ActiveReportJS 뷰어에서 보고서 정의를 로드하거나 지원되는 형식 중 하나로 보고서를 내보낼 수 있습니다. 자세한 내용은 다음 페이지를 확인하십시오.
다음은 ActiveReportsJS 보고서 뷰어에 현재 표시된 보고서를 표시하는 React 응용 프로그램용 onRender
처리기의 예입니다.
import React from "react";
import "./App.css";
import {
Viewer as ReportViewer,
Designer,
} from "@mescius/activereportsjs-react";
import "@mescius/activereportsjs/styles/ar-js-ui.css";
import "@mescius/activereportsjs/styles/ar-js-viewer.css";
import "@mescius/activereportsjs/styles/ar-js-designer.css";
function App() {
const viewerRef = React.useRef();
const [viewMode, setViewMode] = React.useState(false);
const onRender = (report) => {
setViewMode(true);
viewerRef.current?.Viewer.open(report.definition);
return Promise.resolve();
};
return (
<div id="app-host">
<div id="designer-host" hidden={viewMode}>
<Designer onRender={onRender} />
</div>
<div id="viewer-host" hidden={!viewMode}>
<ReportViewer ref={viewerRef} />
</div>
</div>
);
}
export default App;
React, Angular, Vue 및 순수 JavaScript 응용 프로그램에 대한 전체 예제는 라이브 데모를 참조하십시오.
응용 프로그램에서는 ActiveReportJS 디자이너 인스턴스의 getReport 메서드를 사용하여 현재 표시된 보고서 정보를 가져올 수 있습니다. 이러한 접근 방식은 지원되는 형식 중 하나로 보고서를 내보내는 사용자 정의 보고서 미리 보기
UI를 추가합니다. 다음은 Angular 응용 프로그램에 대해 이와 같이 구현한 예입니다.
import { Component, ViewChild } from '@angular/core';
import { DesignerComponent } from '@mescius/activereportsjs-angular';
import { Core, PdfExport } from '@mescius/activereportsjs';
@Component({
selector: 'app-root',
template:
'<div id="designer-host"><button (click)="onPdfPreview()">Pdf Preview</button><gc-activereports-designer [report]="report"> </gc-activereports-designer></div>',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
@ViewChild(DesignerComponent, { static: false })
reportDesigner: DesignerComponent;
report = { id: 'assets/report.rdlx-json', displayName: 'my report' };
onPdfPreview = async () => {
const reportInfo = await this.reportDesigner.getReport();
const report = new Core.PageReport();
await report.load(reportInfo?.definition);
const doc = await report.run();
const result = await PdfExport.exportDocument(doc);
result.download('exportedreport.pdf');
};
}
React, Angular, Vue 및 순수 JavaScript 응용 프로그램에 대한 전체 예제는 라이브 데모를 참조하십시오.