Skip to content

Bookmarks

amit-shuster edited this page Mar 18, 2018 · 17 revisions

By using bookmarks in Power BI, you can capture the current configured view of a report page, including filtering and the state of visuals.

Bookmarks in Power BI

To read about bookmarks in Power BI please refer to Bookmarks Documentation.

Bookmarks API

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.

Bookmark definition

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.

Code Samples

Get a list of bookmarks.

    // Get a list of bookmarks
    let bookmarks = report.bookmarksManager.getBookmarks();

Apply a bookmark by name

    // apply a bookmark with a name: Bookmark1234
    report.bookmarksManager.apply("Bookmark1234");

Reload a report without a bookmark applied.

    report.reload();

Capture the event of bookmark applied.

    // Listen on bookmark applied event and log the applied bookmark name to browser console.
    report.on("bookmarkApplied", (event) => {
        console.log(event.detail.name);
    });

Show/Hide the bookmarks navigation pane.

    // Show bookmarks navigation pane
    report.bookmarksManager.updateSettings({
        bookmarksPaneEnabled: true
    });

    // Hide bookmarks navigation pane
    report.bookmarksManager.updateSettings({
        bookmarksPaneEnabled: false
    });

Enter/Exit bookmarks presentation mode.

    // Enter presentation mode
    report.bookmarksManager.play(models.BookmarksPlayMode.Presentation);

    // Exit presentation mode
    report.bookmarksManager.play(models.BookmarksPlayMode.Off);

Capture and get a current view as a bookmark object, and apply it back on the current session.

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);