Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ys01
Regular Visitor

How to create a blank embedded paginated report using the powerbi-client library as master user

Hello! I'm using the powerbi-client library to create a new report in an container. I am able to use the createReport method to create reports but not paginated reports. This is the code I'm using to create reports: 

import * as pbi from "powerbi-client";
const
powerbi = new pbi.service.Service(
            pbi.factories.hpmFactory,
            pbi.factories.wpmpFactory,
            pbi.factories.routerFactory
        );
        let embedCreateConfiguration = {
            tokenType: 1,
            accessToken: "<access_token>",
            embedUrl: "https://app.powerbi.com/reportEmbed",
            datasetId: "<dataset_id>",
        };
        let embedContainer = document.getElementById("embed");
        let report = powerbi.createReport(
           embedContainer,
            embedCreateConfiguration
        );
My idea to create paginated reports was to change the embed url to "https://app.powerbi.com/rdlEmbed". When I do that I get an infinte spinner animation and no report is being created. 
 
I'm generating an access token by passing this request body in:
{"datasets": [{"id": "<dataset_id>"}, "targetWorkspaces": [{"id": "<workspace_id>"}]]
Is this soley because I'm using a master user to authenticate? Or is this due to some malformed configuration that I'm passing into the library? Thanks in advance!
1 ACCEPTED SOLUTION
johnbasha33
Solution Sage
Solution Sage

Hi @ys01  

here is a sample attempt i made to connect to JS script. 

var embedConfiguration = {
type: 'report',
accessToken: '<embed_token>',
embedUrl: '<report_url>',
tokenType: models.TokenType.Embed,
settings: {
filterPaneEnabled: false,
navContentPaneEnabled: false
}
};

var reportContainer = document.getElementById('reportContainer');

var report = powerbi.embed(reportContainer, embedConfiguration);

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

View solution in original post

1 REPLY 1
johnbasha33
Solution Sage
Solution Sage

Hi @ys01  

here is a sample attempt i made to connect to JS script. 

var embedConfiguration = {
type: 'report',
accessToken: '<embed_token>',
embedUrl: '<report_url>',
tokenType: models.TokenType.Embed,
settings: {
filterPaneEnabled: false,
navContentPaneEnabled: false
}
};

var reportContainer = document.getElementById('reportContainer');

var report = powerbi.embed(reportContainer, embedConfiguration);

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.