Forum Discussion

MaheshMole's avatar
MaheshMole
Frequent Visitor
6 years ago

Power BI Bookmark for Embedded report - Capture api not working

We are trying to show all bookmarks, capture and apply using Power BI Java scripts bookmark API (Bookmarks Java Script API ) in our application which uses embedded reports.

The capture API is not working for  power BI embedded reports. Do we know how we can capture the bookmark in Power BI Embedded?

 

We can apply and show "Report Bookmarks" using Power BI Java scripts in embedded reports.

The documentation (https://azure.microsoft.com/en-us/updates/power-bi-embedded-bookmarks-api ) shows we can capture but its not working and we don't have any error.

5 Replies

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi MaheshMole ,

     

    Does this api not work on your side? Based on this document, it should be saved in application database and will be invalid after report changed

     


    Best regards,

     

    • MaheshMole's avatar
      MaheshMole
      Frequent Visitor

      These call returns some objects with state and bookmark name

       

       

       // Capture the current view
          this.embedReport.bookmarksManager.capture().then( capturedBookmark  =>
          {
            // Applied previously captured state
            this.embedReport.bookmarksManager.applyState(capturedBookmark.state).then( r =>{
              debugger;
            }).catch( err => {
              console.log("Error while capture bookmark" +  err);
            });
          });

       

       

      But when I call getBookmarks, it doesn't return any captured bookmarks. This getBookmarks only is not working. We are able to apply bookmark using captured state in different session. 

      Do you know how we can get this getBookmarks API working? 

       

       

       this.embedReport.bookmarksManager.getBookmarks().then( bookmarks => {
                  bookmarks.forEach( b => console.log("Bookmark Name:" + b.name + ", State:" + b.state));
                }).catch( err => {
                  console.log("Error while getBookmarks Error:" +  err);
                });

       

  • AbdelSolis's avatar
    AbdelSolis
    Frequent Visitor

    Hi, guys.

    I'm trying to export to a pdf file a power bi embedded report in a custom app with the current values of the report but when I use this function: let capturedBookmark = report.bookmarksManager.capture();  this error shows to me:

    message: "captureBookmarkFailed", detailedMessage: "Invalid bookmark request", level: 3. 

    So I was wondering if anybody had the same error and how did you solve it?

     

    Thanks in advance.

  • kohder's avatar
    kohder
    Frequent Visitor

    AbdelSolis 


    Check the version of you powerbi-client package.

    In my case I found that an environment running version 2.15.1 was raising this exception.

     

    Not sure what the problem is with this version, but if you explicitly update your package.json to target 2.14.1 the problem seems to disappear.