将PowerBI集成到ASP.NET CORE和Angular应用程序中

时间:2018-10-25 16:10:07

标签: angular asp.net-core tfs powerbi-desktop

我是PowerBI的新手,我需要为ASP.NET Core应用程序生成PowerBI报告/仪表板。如何将PowerBI集成到Angular6应用程序中以生成Power BI报告?

任何帮助将不胜感激。

我将此代码添加到了component.ts中,但仍然没有显示报告。

getReport() {

    const config = {
        type: 'report',
        id: 'b5f50796-6e97-4dc5-a755-00c',
        embedUrl:
            'https://app.powerbi.com/dashboardEmbed?dashboardId=b5f50796-6e97&groupId=be8908da-da25-452e-b220&config=eyJjbHVzdGVyVXJsIjo',
        accessToken: "H4sIAAAAAAAEAB1Wt86FDJZ7l79lJDJcRpqCnHOmI",
        settings: {
            filterPaneEnabled: true,
            navContentPaneEnabled: true
        }
    };


    //this.pbiContainerElement = <HTMLElement>(document.getElementById('pbi-container'));
   // this.powerBiService.embed(this.pbiContainerElement, config);//new
    // 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");
    });
}

0 个答案:

没有答案