Forum Discussion

pellea's avatar
pellea
Regular Visitor
8 years ago

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

      • Anonymous's avatar
        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

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft 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

    • pellea's avatar
      pellea
      Regular 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,
                      }
                  }
              };