cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syeda2109 Frequent Visitor
Frequent Visitor

Re: Angular 2 and Power BI Embedded

Hi ! @gauz09 I tried every steps but still my code isn't working. Can you look over this issue? Any advice will be appriciatable.

 

HTML Code:

 

                <div id="pbicontainer" style="height:800px;"></div>

Type script:

 

import { NgxPowerBiService } from 'ngx-powerbi';

 getReport() {
        
        const config = {
            type: 'report',
            id: 'b5f50796-6e97-4dc5',
            embedUrl:
                'https://app.powerbi.com/dashboardEmbed? 
                 dashboardId=b5f50796-6e97&groupId=be8908da-da25- 
                 452ed&config=eyJjbHVzdGVyVXJsIj',
            accessToken: "H4sIAAAAAAAEAB1Wt86F",
            settings: {
                filterPaneEnabled: true,
                navContentPaneEnabled: true
            }
        };

        // Grab the reference to the div HTML element that will host the report.
        let pbicontainer = <HTMLElement>document.getElementById('pbicontainer');
        let report = this.powerBiService.embed(pbicontainer, config);


        // Report.off removes a given event handler if it exists.
        report.off("loaded");

        // Report.on will add an event handler which prints to Log window.
        report.on("loaded", function () {
            console.log("Loaded");
        });
    }