Closed Sushmasrig closed 1 year ago
Microsoft recommends using Export To File API for exporting PowerBI Report.
Export To File REST API helps us to export the report. Refer Export Power BI embedded analytics reports API documentation.
We also have ani API report.print()
this method prints only the active page of report invoking windows.print()
on embedded iframe component.
Feel Free to reach out if you have any other queries.
Thank you for sharing this information. report. print() is working fine for me.
I have checked the documentation for .pptx and .png but it will be helpful if there is any working example or any sample code for reference.
From the documentation, export job consists of four steps.
exportId
( ExportToFile or ExportToFileInGroup)Refer to this Export PowerBI Embedded Report using Export To File APIs gist file for sample running code.
Feel free to reach out if you have any other queries.
I tried as you mentioned in your code
URL: https://api.powerbi.com/v1.0/myorg/reports/{myReportId}/ExportTo
.
Payload: {"format":"PPTX","powerBIReportConfiguration":{}}
Http Error: 403.
I even checked my accessToken and reportId are being passed correctly but still getting 403 error.
@Sushmasrig ,
To use ExportToFile
API, reports must reside in Premium or Embedded Capacity. Refer to Limitations documentation and verify.
Power Bi react client has internal export functionalities, but for my use case, I want to use external export(Pdf/png/pptx) instead of internal. I used third-party libraries to export, everything is rendering correctly except the power bi client component. I am attaching the link for reference: https://stackblitz.com/edit/react-nyqusc?file=src%2FApp.js
I also used other Pdf libraries but still power bi client component is not able to export(visible) in pdf and png.