This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi
I use the ExportTo API to export reports to PDF
This works correctly, but I'd like to also export the filters the user applies to the embedded report.
To do this, I capture the state:
async function CaptureFilters() {
var filter = await report.bookmarksManager.capture();
return filter.state;
}
And I pass it to the API as a property:
"defaultBookmark": {
"state": "xxx"
}
This works correctly if the user sets filters on all pages
If the user sets filters for a single page and then moves to another page and launches the export, the filters for that page aren't captured, but only the ones where they're currently positioned
How can I fix this?
Thanks
Solved! Go to Solution.
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
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |