Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
DavideBono97
Helper I
Helper I

PowerBI report Embedded - Export to PDF

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

1 ACCEPTED SOLUTION
v-sgandrathi
Community Support
Community Support

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

View solution in original post

1 REPLY 1
v-sgandrathi
Community Support
Community Support

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.