Forum Discussion
REST API for Power BI, Reports - Export To File giving error
- 6 years ago
After reading hundreds of tutorials, finally I get a solution that at least is working fine for me. The blog that helped me the most was:
in https://blog.crossjoin.co.uk/
The steps for me were:
- Azure Power bi resource name embeeded app must be running BEFORE you login into the "try it" button of the API documentation page. and then (copy pasted from the refered blog). I was pausing the app while finding the solution to stop the billing counter.
- Export To File In Group must be called first, to start the process of exporting either a Power BI report or a paginated report to a file. Exporting may take some time, though, so the exported file doesn’t get returned at this point. In the headers of the response there is a retry-after value in seconds telling you how long you must wait initially, before…
- …calling Get Export To File Status In Group to find out whether the export is ready or not. If it isn’t ready you again need to wait the number of seconds specified in the retry-after header before checking the status again. If it is ready, you can then…
- …call Get File Of Export To File In Group to download the export file.
Hope that works for you aswell.
I'm also getting the same error. I am also using A1 capacity.
- I have tested the API here https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofile#code-try-0
- I have enabled export reports as images as described here: https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to
What else should I be considering! Are there specific changes I need to make to the workspace or the power bi capacity, should I be using a service principal.
Any assistance appreciated.
After reading hundreds of tutorials, finally I get a solution that at least is working fine for me. The blog that helped me the most was:
in https://blog.crossjoin.co.uk/
The steps for me were:
- Azure Power bi resource name embeeded app must be running BEFORE you login into the "try it" button of the API documentation page. and then (copy pasted from the refered blog). I was pausing the app while finding the solution to stop the billing counter.
- Export To File In Group must be called first, to start the process of exporting either a Power BI report or a paginated report to a file. Exporting may take some time, though, so the exported file doesn’t get returned at this point. In the headers of the response there is a retry-after value in seconds telling you how long you must wait initially, before…
- …calling Get Export To File Status In Group to find out whether the export is ready or not. If it isn’t ready you again need to wait the number of seconds specified in the retry-after header before checking the status again. If it is ready, you can then…
- …call Get File Of Export To File In Group to download the export file.
Hope that works for you aswell.
- Anonymous6 years agoNot applicable
I have done the similar steps and used the 3 REST APIs you mentioned in my Flow to get the report PDF. Its working all fine.
As a next step, I want to export only certain pages of my report in PDF.
Have you tried that or have any leads on how it can be done?
Regards
- sanjeevgaut5 years agoFrequent Visitor
Anonymous , can you share your code, i am also trying to download report as file but getting error.
I have followed microsoft documentation , not working for me