Hide page in page bar in Power BI embedded

◇◆丶佛笑我妖孽 提交于 2020-01-06 06:37:08

问题


I'm embedding Power BI report into our application. I want to show / hide available pages of report based on state of our application. Is there any Javascript API to hide concrete page?

I known, that it is possible to hide page in Power BI desktop, but I need it modify dynamically for concrete user session.


回答1:


I don't think this is currently supported. At least I don't see in page.ts source code a way to do this.

In Microsoft official demo they hided the navigation bar and used buttons in the web page to change the active report page, so you can use this workaround too.

Page navigation is enabled/visible by default but can be disabled/hidden by adding the attribute on the element or specifying the setting in the embed configuration:

So to hide page navigation panel add attribute like this:

<div ... powerbi-settings-nav-content-pane-enabled="false"></div>

Or specify it in the embedded configuration details:

var embedConfig = {
    ...
    settings: {
        navContentPaneEnabled: false
    }
};

To switch the report to some page, call it's setActive method:

const page = report.page('ReportSection1');
page.setActive();


来源:https://stackoverflow.com/questions/54232586/hide-page-in-page-bar-in-power-bi-embedded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!