Forum Discussion
Power BI Bookmark for Embedded report - Capture api not working
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,
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);
});
- lianaalezambori6 years agoRegular Visitor
Hi,
Did you solved the problem?
I tried to use Capture Bookmarks in a report embedded in LocalHost using the steps from here: https://app.powerbi.com/embedsetup/AppOwnsData?session_id=7f09dbe3-8fc1-45c1-ac0c-adb3a028b171
I create in MS VIsual Studio a new file script where I coped the code from here: https://github.com/microsoft/PowerBI-JavaScript/blob/master/demo/v2-demo/live_showcases/bookmarks/showcase_bookmarks.js
I reffer this script in EbedReport.cshtml (<script src="~/scripts/showcase_bookmarks.js"></script>), but when I run the code nothing change in the page where the report is embedded.
How should I proceed?
Thanks!