Export Power BI reports to PDF, PPTX or PNG files using REST API
Published date: 09 March, 2020
Power BI now has an additional set of capabilities that allow you to export a Power BI report by using a REST call to the following file formats – PDF, PPTX (PowerPoint) and PNG.
Use this Export-To-File API in a variety of ways:
- Create a send to print button – In your application, create a button that, when clicked, triggers an export job. The job can export the viewed report as a PDF or a PPTX, and when it’s complete, the user can receive the file as a download. As the API is asynchronous, it may take some time for the file to be available.
- Email attachment – Send an automated email at set intervals with an attached PDF report. This can be useful if you want to automate sending a weekly report to executives.
When the Export-To-File API is called, it triggers an export job. After triggering the export job, use the Polling API to track the job until it’s complete. When the export job is complete, the Polling API call returns a Power BI URL to access the file (the URL is available for 24 hours). The API supports concurrent export job requests – the number of jobs you can run simultaneously depends on the SKU your report resides on.
The following set of capabilities are provided with the new API:
- Export selected report pages – Specify which pages you want to export and in what order.
- Bookmarks – Using bookmarks capabilities, export a report in a specific state once you have applied filters to it.
- Row-level security (RLS) – Use row-level security (RLS) to export a report showing data that’s only visible to certain users. For example, if you’re exporting a sales report that’s defined with regional roles, you can programmatically filter the report so that only a certain region is displayed.
- Data protection – The PDF and PPTX formats support sensitivity labels. If you export a report with a sensitivity label to a PDF or a PPTX, the exported file will display the report with its sensitivity label.
- Localisation – When using the API, you have the ability to pass your desired local. The localisation settings affect the way the report is displayed, for example, by changing formatting according to the selected locale.
Note that both the report and the dataset of the report you’re exporting must reside on a premium or embedded capacity. Other preview limitations are detailed in the Export report to file article.
Please also be aware that as all new Power BI APIs, the Export-To-File API is only included in the Power BI APIs .NET SDK v3.