Forum Discussion
Embed report with load()/render() error: "Report or group ID do not match loaded configuration"
Hello,
I successfully displayed an embed report using the load()/render() functions. But when I specify a configuration object in the render() method, I get this error: "Report or group ID do not match loaded configuration".
Here is the code:
var config = {
type: 'report',
embedUrl: "@Model.EmbedUrl",
tokenType: models.TokenType.Embed,
accessToken: "@Model.Token",
id: "@Model.Id"
};
var embedContainer = $('#embedContainer')[0];
var report = powerbi.load(embedContainer, config);
report.on("loaded", function () {
report.render(config);
});Why do I get this error, I'm pretty sure the id are the same ...
Thanks,
Pellea.
6 Replies
- AnonymousNot applicable
Hi pellea,
what will happen if you use
// Embed the report and display it within the div container. var report = powerbi.embed(embedContainer, config);
instead of powerbi.load? This is what the live demo for the SDK is using (https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html).
Hope it helps.
Thanos
- pelleaRegular Visitor
The embed method displays correctly the report.
But I would like to use the phased API with preload/load/render.
https://github.com/Microsoft/PowerBI-JavaScript/wiki/Phased-Embedding-API
- AnonymousNot applicable
Hi pellea,
what if you use this: var report = powerbi.load(config); insted of yours powerbi.load(embedcontainer, config)?
And this report.render(config); is not needed if you don't modify the configuration settings. You can call just report.render();
Thanos
- v-jiascu-msftMicrosoft Employee
Hi Pellea,
Just see from the code, you didn't even make changes of the config. How can the IDs be different? Can you share the customized config? BTW, I tested it successfully.
>>>Please note, reportId & embedUrl properties MUST remain the same.
Best Regards,
Dale
- pelleaRegular Visitor
That's a good question :)
BTW, the error message is not helpful (I'm pretty sure the error is elsewhere).
Here is the config I'm using:
config = { type: 'report', embedUrl: "@Model.EmbedUrl", tokenType: models.TokenType.Embed, accessToken: "@Model.Token", id: "@Model.Id", permissions: permissions, settings: { filterPaneEnabled: false, navContentPaneEnabled: false, layoutType: models.LayoutType.Custom, customLayout: { displayOption: models.DisplayOption.FitToPage, } } };