March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I've setup the sample user owns data app from Microsoft and all works well. However, rather than loading the report in a container on the same page as the report selection, I want it to load in a new window. I have tried edditing the embed.js file accordingly and while a window loads and the powerbi loading icon displays, the report never loads. Is it possible to make this work?
Solved! Go to Solution.
Hi @JPHK ,
Please modify your embed.js
file as below:
// Get the report details from your application
let reportId = '...';
let embedUrl = '...';
let accessToken = '...';
// Create a new window
let reportWindow = window.open('report.html');
// Wait for the new window to load
reportWindow.onload = function() {
// Get the Power BI service object
let powerbi = window.powerbi;
// Embed configuration used to describe the what and how to embed
let config = {
type: 'report',
tokenType: powerbi.models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: reportId,
permissions: powerbi.models.Permissions.All,
settings: {
filterPaneEnabled: true,
navContentPaneEnabled: true
}
};
// Get a reference to the embedded report HTML element
let reportContainer = reportWindow.document.getElementById('reportContainer');
// Embed the report and display it within the div container
let report = powerbi.embed(reportContainer, config);
};
Best Regards
Hi @JPHK ,
Please modify your embed.js
file as below:
// Get the report details from your application
let reportId = '...';
let embedUrl = '...';
let accessToken = '...';
// Create a new window
let reportWindow = window.open('report.html');
// Wait for the new window to load
reportWindow.onload = function() {
// Get the Power BI service object
let powerbi = window.powerbi;
// Embed configuration used to describe the what and how to embed
let config = {
type: 'report',
tokenType: powerbi.models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: reportId,
permissions: powerbi.models.Permissions.All,
settings: {
filterPaneEnabled: true,
navContentPaneEnabled: true
}
};
// Get a reference to the embedded report HTML element
let reportContainer = reportWindow.document.getElementById('reportContainer');
// Embed the report and display it within the div container
let report = powerbi.embed(reportContainer, config);
};
Best Regards
Perfect. Thank you very much.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
7 | |
3 | |
2 | |
1 | |
1 |
User | Count |
---|---|
8 | |
3 | |
2 | |
2 | |
2 |