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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Export to excel for paginated reports using power bi API gives corrupt file

I am trying to call https://docs.microsoft.com/en-us/rest/api/power-bi/reports/getfileofexporttofileingroup Power BI API using azure function to get the file export in excel for paginated reports. I am calling the API using powershell, it works and response is generated.

I am using this output in logic apps to create excel report in one drive. The report gets created but while opening the excel it gives error "File is corrupt or invalid file".

Also i observed the content length from the azure function is different than direct API call using fiddler (content lenght from azure function is more).

Any suggestions how to fix the export to excel ? And why there is difference in content length?

1 REPLY 1
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

In other words, the exported file obtained through this API cannot be opened?

Maybe you can refer to the link.

c# - Angular/Web API 2 returns invalid or corrupt file with StreamContent or ByteArrayContent - Stack Overflow

 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.