Embed a paginated report
Tip
Try embedding a paginated report or experiment with our client APIs in the Explore our APIs section of the Power BI Embedded Analytics Playground.
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 define the content and specify its settings in a configuration object. Then you pass that object to the API.
When you embed a paginated report, use a configuration object of type IEmbedConfigurationBase:
export interface IEmbedConfiguration {
accessToken: string;
uniqueId: string;
embedUrl?: string;
id?: string;
hostname?: string;
settings?: IPaginatedReportSettings;
tokenType?: 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.uniqueId- The ID of the Power BI report that you're embedding.embedUrl- The URL of the report that you're embedding. This URL becomes the source of the HTMLiframeelement that contains the embedded report. Specifically, the API assigns the URL to thesrcattribute of theiframe. You can use a Report API to obtain this URL. Two examples are:id- The workspace ID of the report.hostname- The defaulthostnamevalue is app.powerbi.com. If you're using a sovereign cloud, provide the URL here. If you provided a value forembedURL, thehostnamewill be ignored.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.
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
enabledproperty to befalse, the Parameters button isn't available.By default, the API collapses the parameter panel. If you set the panel's
expandedproperty totrue, the API loads the report with this panel expanded.This code shows one way to configure the
settingsproperty: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.Aadif you're embedding for your organization (the user owns the data). - Use
models.TokenType.Embedif you're embedding for your customers (the app owns the data).
See Understand the different embedding solutions for more information.
- Use
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,
uniqueId: 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);
Considerations and limitations
The bootstrapped method isn't supported for paginated reports.