Lesa á ensku Breyta

Deila með


Embed a paginated report

APPLIES TO: Power BI Report Builder Power BI Desktop

This article provides an overview of the differences between embedding a Power BI report, and embedding a Power BI paginated report. The article is aimed at developers using Power BI embedded analytics to embed a paginated report.

Semantic model considerations

A Power BI report is always bound to a single data source. However, a paginated report doesn't require a Power BI semantic model as a data source. A paginated report can also be built on multiple semantic models. This means you cannot rely on the datasetId property of a report object, when embedding a paginated report.

Token considerations

There are some special considerations when generating an embed token for a paginated report with an Embed for your customers solution. If the paginated report has one or more Power BI semantic models configured as its data sources, you must create a GenerateTokenRequestV2Dataset object for each semantic model, with the following parameters:

  • xmlaPermissions must be set to ReadOnly

  • allowEdit must be set to false

Unsupported features

Before embedding a paginated report, consider the following Power BI features which aren't supported:

Code example

The following code listing demonstrates generating an embed token to embed a paginated report built on top of a Power BI semantic model.

JavaScript
string datasetId = "11111111-1111-1111-1111-111111111111";
Guid reportId = new Guid("22222222-2222-2222-2222-222222222222");

// create semantic model request for embed token with XmlaPermissions.ReadOnly
var datasetRequests = new List<GenerateTokenRequestV2Dataset> {
  new GenerateTokenRequestV2Dataset(datasetId, xmlaPermissions: XmlaPermissions.ReadOnly)
};

// create report request for embed token with allowEdit set to false
var reportRequests = new List<GenerateTokenRequestV2Report>{
  new GenerateTokenRequestV2Report(reportId, allowEdit: false)
};

// create token request
var tokenRequest = new GenerateTokenRequestV2 {
  Datasets = datasetRequests,
  Reports = reportRequests,
};

// call GenerateToken to retrieve embed token from Power BI REST API
var EmbedTokenResult = pbiClient.EmbedToken.GenerateToken(tokenRequest);

// extract embed token for embed token result
var embedToken = EmbedTokenResult.Token;