I'm working on Power BI Embedded API. I've been embedded in a report on my web application.
Now my client has a requirement to do export in PDF feature with the default state/current values/selected values/filtered values of the report.
Example: The same scenario like, If we see on Power BI service open any report go to File > Export to PDF as shown in the below image
a pop-up will come to ask you to export with current values (means filters/selection that you've applied on the report) or default values (default state of report nothing selected). So in case of current values Power BI service export the report as expected behavior, with filtered data of the report.
But in API I couldn't see this option. I'm following this link to export the power bi embedded report to PDF.
You can use theexportToFileAPI to programmatically export a report in a specific state, after applying filters to it. This is done usingBookmarkscapabilities. To export a report using bookmarks, use thebookmarks JavaScript API.
For example, you can use the bookmark'scapturedBookmark.statemethod to capture the changes a specific user made to a report, and then export it in its current state.
You can use theexportToFileAPI to programmatically export a report in a specific state, after applying filters to it. This is done usingBookmarkscapabilities. To export a report using bookmarks, use thebookmarks JavaScript API.
For example, you can use the bookmark'scapturedBookmark.statemethod to capture the changes a specific user made to a report, and then export it in its current state.
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:
I'm trying below mentioned request for export report with current values but API is throwing error, I appreciate if somebody help me to solved this, i need to fix this ASAP.