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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Export to file API with Current Values

Hi Experts,

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

 

export file.png

 

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.

 

Export with Current Values.png

 

But in API I couldn't see this option. I'm following this link to export the power bi embedded report to PDF.

https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofileingroup

But I'm unable to see current values options in API.

Please help how can I do export report through API with current values as shown in the above images.

Thanks

 

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

The option won't prompt automatically when you use the API, did you specify the export content in the JSON body?

https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofileingroup#powerbireportexportco...

Note that:

You can use the exportToFile API to programmatically export a report in a specific state, after applying filters to it. This is done using Bookmarks capabilities. To export a report using bookmarks, use the bookmarks JavaScript API.

For example, you can use the bookmark's capturedBookmark.state method to capture the changes a specific user made to a report, and then export it in its current state.

Personal bookmarks and persistent filters are not supported.

 

Here're blogs for your reference:

https://blog.crossjoin.co.uk/2020/04/25/calling-the-power-bi-export-api-from-power-automate-part-1-c...

https://blog.crossjoin.co.uk/2020/04/27/calling-the-power-bi-export-api-from-power-automate-part-2-c...

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

4 REPLIES 4
shubh43
Advocate I
Advocate I

Hi,

 

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.

 

API Endpoint:

https://api.powerbi.com/v1.0/myorg/groups/{groupid}/reports/{reportid}/ExportTo

 

Request:

{
"format": "PDF",
"powerBIReportConfiguration": {
"settings": {
"locale": "en-US",
"excludeHiddenPages": "false"
},
"defaultBookmark": "H4sIAAAAAAAAA+1deW8bR5b/KgSB3cwASlD3.."
}
}


Response:
{
"error": {
"code": "BadRequest",
"message": "Bad Request",
"details": [
{
"message": "Error converting value \"H4sIAAAAAAAAA+1deW8bR5...",
"target": "request.powerBIReportConfiguration.defaultBookmark"
}
]
}
}

AbdelSolis
Frequent Visitor

Hi, guys.

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:

message: "captureBookmarkFailed", detailedMessage: "Invalid bookmark request", level: 3. 

So I was wondering if anybody had the same error and how did you solve it?

 

Thanks in advance.

v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

The option won't prompt automatically when you use the API, did you specify the export content in the JSON body?

https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofileingroup#powerbireportexportco...

Note that:

You can use the exportToFile API to programmatically export a report in a specific state, after applying filters to it. This is done using Bookmarks capabilities. To export a report using bookmarks, use the bookmarks JavaScript API.

For example, you can use the bookmark's capturedBookmark.state method to capture the changes a specific user made to a report, and then export it in its current state.

Personal bookmarks and persistent filters are not supported.

 

Here're blogs for your reference:

https://blog.crossjoin.co.uk/2020/04/25/calling-the-power-bi-export-api-from-power-automate-part-1-c...

https://blog.crossjoin.co.uk/2020/04/27/calling-the-power-bi-export-api-from-power-automate-part-2-c...

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

Thanks @v-diye-msft, pretty much clear solution you've provided.

One more question, Is embedded Q&A supports ExportToFile?

Can you also look into these Posts, please?

https://community.powerbi.com/t5/Developer/Export-embedded-Q-amp-A-results-to-PDF/m-p/1378432
https://community.powerbi.com/t5/Developer/Export-embedded-Q-amp-A-results-to-PDF/m-p/1371667#M25738

 

Thanks

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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