angularpowerbipowerbi-embedded

Create new Power BI report embedded in Angular application


I'm using Power BI embedded in an Angular application with Microsoft's library powerbi-client-angular

This works fine viewing and editing a report that exists in Power BI Service. I'm trying now to create a new report (according to the library documentation, this is supported).

I'm getting this error:

Error: Attempted to embed component of type: create but did not find any matching component. Please verify the type you specified is intended.

This is my embedConfig object:

        this.embedConfig = {
            type: 'create',
            embedUrl: 'https://app.powerbi.com/reportEmbed',
            accessToken: this.token, // the dataset token id
            datasetId:  'xxxxxxxxxxxxxx...'
            tokenType: models.TokenType.Embed,
            permissions: models.Permissions.ReadWrite,
            viewMode: models.ViewMode.Edit,
            settings: {
                panes: {
                    filters: {
                        expanded: false,
                        visible: true
                    }
                }
            }
        };

and this is the HTML tag:

         <powerbi-report
            [embedConfig]="embedConfig"
            [cssClassName]="'container'"
            [phasedEmbedding]="false">
        </powerbi-report> 

Any ideas how to fix this? what value should I use in the 'type' attribute?


Solution

  • It's supported. But you're using the wrong selector.It will be powerbi-create-report.

    Refer to this MSFT documentation Create an embedded report