-
Notifications
You must be signed in to change notification settings - Fork 466
Bookmarks
By using bookmarks in Power BI, you can capture the current configured view of a report page, including filtering and the state of visuals.
To read about bookmarks in Power BI please refer to Bookmarks Documentation.
In embedded report, developers can:
- Get a list of bookmarks.
- Apply a bookmark on report load or during session.
- Reload a report without a bookmark applied.
- Capture the event of bookmark applied.
- Show/Hide the bookmarks navigation pane.
- Enter/Exit bookmarks presentation mode.
In addition, developers can:
- Capture and get a current view as a bookmark object.
- Apply a captured bookmark state on report load or during a session.
interface IReportBookmark {
name: string;
displayName: string;
state: string;
}
name: unique identifier of a bookmark. displayName: a display name which will appear in a bookmarks navigation pane. state: a Base64 serialization of a bookmark state. You can save it and apply it back to the report using bookmarksManager.applyState method.
// Get a list of bookmarks
let bookmarks = report.bookmarksManager.getBookmarks();
// apply a bookmark with a name: Bookmark1234
report.bookmarksManager.apply("Bookmark1234");
report.reload();
// Listen on bookmark applied event and log the applied bookmark name to browser console.
report.on("bookmarkApplied", (event) => {
console.log(event.detail.name);
});
// Show bookmarks navigation pane
report.bookmarksManager.updateSettings({
bookmarksPaneEnabled: true
});
// Hide bookmarks navigation pane
report.bookmarksManager.updateSettings({
bookmarksPaneEnabled: false
});
// Enter presentation mode
report.bookmarksManager.play(models.BookmarksPlayMode.Presentation);
// Exit presentation mode
report.bookmarksManager.play(models.BookmarksPlayMode.Off);
A captured state can be saved in application database, and can be applied back on a report in different sessions. If a report changes, captured bookmarks may not be valid, it is recommended to recapture the bookmarks. Managing permissions and usage of the new bookmark is done by the application.
// Capture the current view
let capturedBookmark = report.bookmarksManager.capture();
// Applied previously captured state
report.bookmarksManager.applyState(capturedBookmark.state);