I'm trying to embed a PowerBI report in my webpage
This code works well WHEN the report has been published on Azure. So, providing the good credentials, everything is OK
var config = {
type: 'report',
tokenType: models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: embedReportId,
permissions: models.Permissions.All,
settings: {
filterPaneEnabled: true,
navContentPaneEnabled: true
}
};
// Get a reference to the embedded report HTML element
var reportContainer = $('#embedContainer')[0];
// Embed the report and display it within the div container.
window.powerbi.embed(reportContainer, config);
However, I have some PUBLIC reports.
Absolutely anyone can access them with the url and I'd like to display them the same way I did for "private" reports.
I know I could just do something like :
<iframe src="https://my-public-url" scrolling="no" allowfullscreen="true" style="width: 100%; height: 100%;"></iframe>
But I'd like to know if (and how ?) I could use the window.powerbi.embed
method, providing it an object saying : "here is the my-custom-url for the report, but there's no need for token or id, just get it and display it".
Obviously, if accessToken
or id
is null, then nothing is shown...
I've found the very same question here, but non-answered
Can anyone help me ? Thanks a lot