다음을 통해 공유


성능 향상을 위해 부트스트랩 사용

powerbi.bootstrap 는 개발자가 Power BI 엔터티를 더 빠르게 포함하고 성능을 향상할 수 있도록 클라이언트 SDK 버전 2.9.0에 도입된 메서드입니다.

을 사용하여 powerbi.embed 보고서를 포함하려면 , 및 embedURL와 같은 reportId여러 매개 변수가 accessToken필요합니다. 이러한 매개 변수를 항상 즉시 사용할 수 있는 것은 아닙니다.

powerbi.bootstrap 를 사용하면 필요한 모든 매개 변수를 사용할 수 있기 전에 포함을 시작할 수 있습니다. 부트스트랩 API는 iframe을 준비하고 초기화합니다.

필요한 매개 변수를 받은 powerbi.embed(element, config) 후에는 동일한 HTML 요소에서 를 호출해야 합니다.

부트스트랩 API

메서드는 powerbi.bootstrap(element, config) 요소 및 구성을 수신하며 와 동일합니다 powerbi.embed(...).

/**
    * Given an HTML element and entityType, creates a new component instance, and bootstrap the iframe for embedding.
    *
    * @param {HTMLElement} an HTML Element where you need to embed. must be the same div element you will use in powerbi.embed.
    * @param {IBootstrapEmbedConfiguration} config: a bootstrap config.
    */
bootstrap(element: HTMLElement, config: IBootstrapEmbedConfiguration): embed.Embed;

부트스트랩 포함 구성

interface IBootstrapEmbedConfiguration {
  type: string;
  hostname?: string;
  embedUrl?: string;
  settings?: ISettings;
}

구성 매개 변수:

  • type(필수): 'report', 'dashboard', '타일', 'qna' 또는 'visual'과 같이 포함하려는 엔터티의 형식입니다.
  • hostname: 아직 없는 경우 embedURL 호스트 이름을 제공할 수 있습니다. 호스트 이름은 포함 URL의 도메인 이름입니다. 예를 들어 포함 URL이 ''https://app.powerbi.com/reportEmbed이면 호스트 이름은 ''https://app.powerbi.com/입니다. 호스트 이름 또는 embedUrl이 제공되지 않으면 기본 호스트 이름 인 https://app.powerbi.com/가 사용됩니다.
  • embedUrl: 나중에 powerbi.embed에 제공할 동일한 포함 URL입니다. 호스트 이름 또는 embedUrl이 제공되지 않으면 기본 호스트 이름 인 https://app.powerbi.com/가 사용됩니다.
  • 설정: 보고서를 모바일 레이아웃에 포함하거나 로캘(언어)을 제공하려면 초기 설정에 이러한 매개 변수를 포함합니다.

부트스트랩 샘플

다음 샘플에서는 Power BI 엔터티를 포함할 때 부트스트랩 메서드에 대한 참조를 제공합니다.

참고

embed 매개 변수를 받은 후 를 호출 powerbi.embed 해야 합니다.

보고서를 포함하기 위해 부트스트랩하려면 다음을 수행합니다.

powerbi.bootstrap(
        reportContainerDivElement,
        {
            type: 'report',
        }
    );

dashboard 포함하기 위해 부트스트랩하려면 다음을 수행합니다.

powerbi.bootstrap(
        reportContainerDivElement,
        {
            type: 'dashboard',
            embedUrl: "https://app.powerbi.com/dashboardEmbed?dashboardId=06e3ba63-47ea-4579-b010-fdb5484b325a&config=eyJjbHVzdGVyVXJsIjoiaHR0cHM6mLndpbmRvd3MubmV0In0="
        }
    );

호스트 이름으로만 보고서를 포함하기 위해 부트스트랩하려면 다음을 수행합니다.

powerbi.bootstrap(
        reportContainerDivElement,
        {
            type: 'report',
            hostname: "https://app.powerbi.com"
        }
    );

모바일 레이아웃으로 보고서를 포함하기 위해 부트스트랩하려면 다음을 수행합니다.

powerbi.bootstrap(
        reportContainerDivElement,
        {
            type: 'report',
            hostname: "https://app.powerbi.com",
            settings: {
	            layoutType: models.LayoutType.MobilePortrait
            }
        }
    );

제한 사항

  • 다음 부트스트래핑된 엔터티는 를 호출 powerbi.reset(element)하지 않고는 변경할 수 없습니다.

    • 구성 요소 유형(보고서, dashboard): 예를 들어 보고서를 부트스트랩하는 경우 동일한 HTML 요소에만 보고서를 포함할 수 있습니다.
    • 레이아웃(데스크톱/모바일)
    • 로캘(언어)
  • powerbi.bootstrap 메서드는 페이지를 매긴 보고서를 포함할 때 지원되지 않습니다.

다음 단계