Forum Discussion
Bookmark export functionality in REACT pbi report
I got something working but it's hacky:
report.on('rendered', async () => {
report.bookmarksManager.config = report.config; // this stops the errors for now
const bookmarks = await report.bookmarksManager.getBookmarks();
Really frustrating though. Looks like there's a bug in the js package.
getBookmarks calls isRDLEmbed which expects this.config.embedUrl to be defined, but it's only defined on the report, not the bookmarksManager.
https://github.com/microsoft/PowerBI-JavaScript/blame/master/src/bookmarksManager.ts#L62
Also the official docs about loading a bookmark by name using static config doesn't seem to work either:
Tried downgrading to 2.14.1 as suggested here
https://community.powerbi.com/t5/Service/Power-BI-Bookmark-for-Embedded-report-Capture-api-not-working/m-p/1543270/highlight/true#M115693
But the only thing that worked for me was setting bookmarksManager.config
Edit:
Looks like there's already a pr that'd stop the error. Not sure it'd fix the whole problem though, since the bookmarkManager still wouldn't have config defined.