Embed a paginated report

This article covers the steps for embedding a paginated report in your application. Learn more about paginated reports in What are paginated reports in Power BI Premium?.

How to embed a paginated report

When you embed Power BI content in an app, you use a configuration object to define the content that you're embedding and to specify the content's settings. Then you pass that object to the API.

When you embed a paginated report, use a configuration object of type IPaginatedReportLoadConfiguration:

interface IPaginatedReportLoadConfiguration {
    accessToken: string;
    embedUrl?: string;
    id: string;
    settings?: models.IPaginatedReportSettings;
    tokenType?: models.TokenType;
    type: string;
}

This interface contains the following properties:

  • accessToken - The token that gives you access to the Power BI data that you're embedding. See Understand the different embedding solutions to learn more about access tokens.

  • embedUrl - The URL of the report that you're embedding. This URL becomes the source of the HTML iframe element that contains the embedded report. Specifically, the API assigns the URL to the src attribute of the iframe. You can use a Report API to obtain this URL. Two examples are:

  • id - The ID of the Power BI report that you're embedding.

  • settings - A configuration object of type IPaginatedReportSettings. This interface specifies the appearance of the report's parameter panel, which is the bar underneath the action bar.

    Screenshot that shows an embedded Power B I paginated report. The parameter panel is near the top and is highlighted in red.

    • You can show or hide the parameter panel by clicking the Parameters button on the action bar. That button is available by default. But if you configure the panel's enabled property to be false, the Parameters button isn't available.

    • By default, the API collapses the parameter panel. If you set the panel's expanded property to true, the API loads the report with this panel expanded.

    • This code shows one way to configure the settings property:

      settings: {
          commands: {
              parameterPanel: {
                  enabled: true,
                  expanded: true
              }
          }
      }
      
  • tokenType - The kind of token that gives you access to the Power BI data that you're embedding.

    • Use models.TokenType.Aad if you're embedding for your organization (the user owns the data).
    • Use models.TokenType.Embed if you're embedding for your customers (the app owns the data).

    See Understand the different embedding solutions for more information.

  • type - The kind of content that you're embedding. Use 'report' for a paginated report.

Example

The following example shows you how to embed a paginated report:

// Set up the configuration object that determines what to embed and how to embed it.
let embedConfiguration = {
    accessToken: anAccessToken,
    embedUrl: anEmbedUrl,
    id: aReportId,
    tokenType: aTokenType,
    type: 'report'
};
 
// Get a reference to the HTML element that contains the embedded report.
let embedContainer = $('#embedContainer')[0];
 
// Embed the report.
let report = powerbi.embed(embedContainer, embedConfiguration);

Next steps