Forum Discussion
PowerBI report Embedded - Export to PDF
- 5 months ago
Hi DavideBono97,
In Power BI Embedded, the bookmarksManager.capture() function captures only the current report state for the active page. This means that when exporting, only filters from the page the user is viewing are included. If filters are applied on another page and the user navigates away, those filters will not be captured unless they are part of the report-level state.
To solve this, apply filters at the report level rather than the page level before capturing the bookmark state. You can use the Power BI JavaScript API, such as report.getFilters() and page.getFilters(), to retrieve all active filters, combine them, and then apply them as report-level filters with report.setFilters(). Afterward, call bookmarksManager.capture(). This ensures the captured state, when sent to the ExportTo API via defaultBookmark.state, includes the full filter context across all pages. Alternatively, you can navigate to each page, capture its state, and merge the filters before exporting. This approach ensures the exported PDF includes all user-applied filters from the entire report, not just the active page.
Thank you
Hi DavideBono97,
In Power BI Embedded, the bookmarksManager.capture() function captures only the current report state for the active page. This means that when exporting, only filters from the page the user is viewing are included. If filters are applied on another page and the user navigates away, those filters will not be captured unless they are part of the report-level state.
To solve this, apply filters at the report level rather than the page level before capturing the bookmark state. You can use the Power BI JavaScript API, such as report.getFilters() and page.getFilters(), to retrieve all active filters, combine them, and then apply them as report-level filters with report.setFilters(). Afterward, call bookmarksManager.capture(). This ensures the captured state, when sent to the ExportTo API via defaultBookmark.state, includes the full filter context across all pages. Alternatively, you can navigate to each page, capture its state, and merge the filters before exporting. This approach ensures the exported PDF includes all user-applied filters from the entire report, not just the active page.
Thank you