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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pellea
Regular Visitor

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 6
v-jiascu-msft
Employee
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

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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,
                }
            }
        };
Anonymous
Not 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

 

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

 

 

Anonymous
Not 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

The powerbi.load() methods must have the embedContainer or it's not working.

 

I need update the configuration later. I removed the code for clarity since the problem is not related with that part.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.