Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowGet certified as a Fabric Data Engineer: Check your eligibility for a 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700. Get started
Scenarios:
In Power BI Service, we can export reports in PDF format and easily create documents or slides based on Power BI Reports. Here is another way that allows us to use the Rest API call and export the Power BI Report in PDF. This method cannot be run in Pro and PPU, it is only suitable for implementation in premium workspace.
The specific operation is:
Tip: The position of groupId and reportId is in the URL:
Sample data:
Get data: Samples -- Human Resources Sample.
PBIX visual:
Expected result:
Successfully exported Power BI Report in PDF format through Rest API.
Step 1: Execute the first Rest API and issue the Post command to get the exportId.
Go to the Report – Export to File in Group page.
1). Enter the Report – Export to File in Group page
2). Click Try It, copy the prepared groupId and reportId, and fill in format: "PDF" in the Body
3). Click Run, generate the exportId we need, and save the exportId
Notice:
Introduction of the information in the Body column:
"@odata.context": The content of the Post request sent
"id": action ID of the operation
"createdDateTime": the time when the operation was created
"lastActionDateTime": the last time of the operation
"reportId": report action ID
"status": Status
"percentComplete": complete percentage progress
"expirationTime": the expiration time of operation
Step 2: Execute the second Rest API to query the current status. If the session is successful, go to the third step.
1). Enter the Reports-Get Export to File Status in Group interface
2). Click Try It , copy and paste the prepared groupId, reportId and exportId into the right places
3). Click Run and find that the message "status: Succeeded" appears, the session is successful.
Step 3: Execute the third Rest API, get the Bearer code, and experiment with PDF export.
1). Enter the Reports-Get File of Export to File in Group interface
2). Click Try It, copy and paste the prepared groupId, reportId and exportId into the right places
3). Click Run, If the execution is successful, the Bearer code and Request URL will be obtained, then the experiment is a success.
Step 4: Enter the Postman software and get the PDF file of the Power BI Report.
1). Go to Collections--PBI_API—click the ellipsis—click “Add request”
2). On the new interface that appears, place the Request URL and change it to GET.
3). Click Authorization, change the Type to Bearer Token, and place the Bearer code obtained in the Token column.
4). Click Headers, copy and paste the prepared groupId, reportId and exportId into the right places.
5). Click Send, the PBIX visual object is generated in the Body interface below, and click Save Response-Save to file.
6). Generate PDF.
Note:
Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
Postman related information:
Web version of Postman:
Download Postman:
https://www.postman.com/downloads/
Hope this article can help you solve similar problems.
Author: Yang Liu
Reviewer: Ula Huang, Kerry Wang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.