[{"id":"d404d4eb-0b25-4650-be78-033cc4aa3445","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"5f98443c-9d59-4351-81ad-0910eb2535e7","tags":[{"name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be"}]},{"id":"57569d12-0bea-4995-9743-1b5efb7dfda6","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"0d50ab1e-81c0-49b2-b8cb-1f50a6f3e12b","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"60452ec3-5f68-4e01-b8f0-22ea893bf4ce","tags":[{"name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be"}]},{"id":"938d62d7-9526-479f-9798-31d0f9f58588","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"d778e74c-622b-47d6-b0b1-32e741ee6d1a","tags":[{"name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be"}]},{"id":"3103635f-71c9-4a28-8786-45ae6de6a49f","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"61551de1-9a9f-4a08-b71e-49ca882827f5","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"50134b23-c8f4-4c83-8c49-4f7a4d307585","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"712bddae-c316-4524-add9-6dd487152146","tags":[{"name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be"}]},{"id":"74546345-b13f-4465-a716-7bc0f9c19730","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"8c3493e9-e62c-45b7-9268-825db731f79b","tags":[{"name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be"}]},{"id":"e588ca95-4aba-4e50-a99f-833a98531489","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"50e4fa24-000f-45f0-8f09-9026e40c30ca","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"ebf0ce82-0782-496c-bd66-90f5433e31f2","tags":[{"name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be"}]},{"id":"cc378615-c853-4f3e-994b-9a2260cc06a2","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"4a60e156-0f10-43a2-88bc-9d9691f15137","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"0a0c904c-bbb2-4abe-a626-a06200fb57fe","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"0d56fe97-9840-41da-931f-ad23201cd9e2","tags":[{"name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be"}]},{"id":"9e4f342b-5dcb-4548-a84c-afe71cf5d736","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"64f01bad-a9ca-47a2-b134-b485adffed2c","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"224e6263-b410-4f17-8822-e19f965c509d","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"c90cdefc-81dd-4d8d-b8fa-ed93585c4b23","tags":[{"name":"upd","color":"#7e678a","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"7fcf2480-6c1f-4a24-a5be-35a201d1532b"}]},{"id":"5d5d62ca-5108-4421-a925-f2c187eb2aeb","tags":[{"name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be"}]},{"id":"afb74359-e66d-40e1-a5e2-f7a22468165d","tags":[{"name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be"}]},{"id":"cccfa340-c8a6-43ef-b2cd-f9fe44ce22dc","tags":[{"name":"New","color":"#ed7422","productId":"486064ee-5a7c-4d44-b127-1e19810242b2","links":null,"id":"27b05819-810b-4ea2-b5ea-2857947ce8be"}]}]
        
(Showing Draft Content)

사용자 정의

ActiveReportsJS API를 사용하면 개발자가 도구 모음의 기본 사용자 인터페이스와 뷰어 컴포넌트의 세로 막대를 완전히 덮어쓸 수 있습니다. 이 페이지에서는 특정 응용 프로그램 요구 사항을 충족하는 데 사용할 수 있는 여러 방법을 설명합니다.

도구 모음 레이아웃 설정

ActiveReportJS 뷰어에는 다음과 같이 기본 제공되는 3가지 도구 모음 레이아웃이 있습니다.

  • 일반 - 기본 레이아웃

  • 전체 화면 - 뷰어의 전체 화면 모드가 켜져 있는 경우 표시됨

  • 모바일 - 좁은 화면에서 표시됨

기본적으로 각 레이아웃에는 다음 항목이 포함되어 있습니다.

내부 ID

설명

$navigation

첫 페이지로 이동, 이전 페이지로 이동, 페이지 번호/전체 페이지 수, 다음 페이지로 이동, 마지막 페이지로 이동 버튼

$split

구분 기호

$refresh

보고서 새로 고침 버튼

$history

부모 보고서로 이동, 기록에서 뒤로 이동, 기록에서 앞으로 이동 버튼

$zoom

확대/축소 모드 드롭다운

$fullscreen

전체 화면 모드 설정/해제 버튼

$print

인쇄 버튼

$singlepagemode

단일 페이지 모드로 전환 버튼

$continuouspagemode

연속 페이지 모드로 전환 버튼

$galleymode

갤러리 페이지 모드로 전환 버튼

뷰어 도구 모음 속성의 updateLayout 메서드를 사용하여 각 레이아웃 모드의 도구 모음에서 지정된 항목만 표시할 수 있습니다. 다음은 React 응용 프로그램에서 이 접근 방식을 사용하여 일반 레이아웃에서 "확대/축소", "전체 화면 설정/해제" 및 "인쇄" 항목을, 전체 화면 레이아웃에서 "전체 화면 설정/해제" 및 "인쇄" 항목을, 모바일 레이아웃에서 "탐색" 항목만 표시하는 예입니다.

import { Viewer } from "@grapecity/activereports-react";

const ViewerApp: React.FC = () => {
  const viewerRef = React.useRef < Viewer > null;

  React.useEffect(() => {
    const viewerInstance = viewerRef.current?.Viewer;
    viewerInstance?.toolbar.updateLayout({
      default: ["$zoom", "$split", "$fullscreen", "$split", "$print"],
      fullscreen: ["$fullscreen", "$split", "$print"],
      mobile: ["$navigation"],
    });
  }, []);
  return (
    <div id="viewer-host">
      <Viewer
        ref={viewerRef}
        report={{ Uri: "/reports/Customers.rdlx-json" }}
      />
    </div>
  );
};

이 온라인 데모에서는 React, Angular, Vue 및 순수 JavaScript 응용 프로그램에서 이 접근 방식의 완전한 예를 확인할 수 있습니다.

도구 모음 항목의 기본 동작 업데이트

React, AngularVue 래퍼에서도 액세스할 수 있는 뷰어 컴포넌트 도구 모음 속성의 updateItem 메서드는 도구 모음 항목의 기본 동작을 재정의하는 데 사용할 수 있습니다. 예를 들어 응용 프로그램에서 분석을 추가하고 사용자가 보고서를 인쇄할 때 분석 서버로 이벤트를 보내려는 경우 다음 코드를 사용할 수 있습니다. 다음 예는 React 응용 프로그램에 해당하지만 Angular, Vue 및 순수 JavaScript 응용 프로그램에 동일한 기법을 사용할 수 있습니다.

import { Viewer } from "@grapecity/activereports-react";

const ViewerApp: React.FC = () => {
  const viewerRef = React.useRef < Viewer > null;

  React.useEffect(() => {
    const viewerInstance = viewerRef.current?.Viewer;
    viewerInstance?.toolbar.updateItem("$print", {
      action: function () {
        ga("send", {
          hitType: "event",
          eventCategory: "action",
          eventAction: "print",
          eventLabel: "report",
        });
        viewerInstance.print();
      },
    });
  }, []);
  return (
    <div id="viewer-host">
      <Viewer
        ref={viewerRef}
        report={{ Uri: "/reports/Customers.rdlx-json" }}
      />
    </div>
  );
};

Configuring the Panels Layout

The PanelsLayout property of the React, Angular, and Vue wrappers and the options object that is passed into the Viewer constructor determines the location of the Search, Export, Document Map and Parameters panels. By default these panels alongside their open buttons locate on the left side of the viewer interface. You can set the PanelsLayout property to sidebar to change the location of the panels to the right side and the open buttons on the toolbar:

image.d9472d

Configuring the Parameters Panel Location

The location of the Parameters Panel can be adjusted using the ParameterPanelLocation property available in the React, Angular, and Vue wrappers. In a pure JavaScript application, you can set this property via the options object that is passed into the Viewer constructor. This property can be set to one of the following values:

  • auto - If the report utilizes the Custom Parameters View, the Parameters Panel is positioned at the top of the viewer component. If not, it's placed on the left side of the viewer.

  • default - The Parameters Panel is located on the left or on the right side of the viewer, depending on the PanelsLocation value described above.

  • top - The Parameters Panel is located at the top of the viewer.

  • bottom - The Parameters Panel is positioned at the bottom of the viewer.


도구 모음 및 사이드바 교체

마지막으로, 뷰어 컴포넌트의 toolbarVisiblesidebarVisible 속성(React, AngularVue 래퍼에 사용할 수 있음)을 사용하여 보고서 뷰어의 기본 도구 모음과 세로 막대 컴포넌트를 숨길 수 있습니다. 이 접근 방식은 공개 API를 사용하여 뷰어 기능을 호출하는 데 사용자 정의 UI를 사용하기로 결정한 경우 유용할 수 있습니다.

관련 항목