Reputation: 93
I'm embedding a Power BI report using the JavaScript API and want to know if there's a way to set the Bookmark Pane to be collapsed by default when the report loads. Ideally, I'd like to control this programmatically so that users see the pane in a collapsed state initially, but can expand it if needed.
Is there any setting or method in the Power BI JavaScript API that allows configuring the initial state of the Bookmark Pane?
I use this code for see Bookmark Pane on my Embedded report :
panes : {
bookmarks: {
visible: true
}
}
Thanks
Upvotes: 1
Views: 147
Reputation: 1810
Yes, you can set the bookmark panes in collapsed initially. While embedding the report, pass the visible state to false. Your embedConfig should look something like this while embedding the report for first time.
let config = {
type: 'report',
tokenType: tokenType,
accessToken: accessToken,
embedUrl: embedUrl,
id: embedReportId,
settings: {
panes: {
bookmarks: {
visible: false
}
}
}
};
Once the report gets embedded with the bookmarks pane in collapsed state using the Power BI Client JavaScript API, you can toggle between hidden or visible state.
Refer to Microsoft documentation Show or Hide Bookmarks in Power BI Embedded
Upvotes: 0