Reputation: 95
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.
Upvotes: 1
Views: 8088
Reputation: 13440
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();
Upvotes: 1