report export in PDF format in Power BI Embedded

Viewed 516

We are embedding power bi reports in a customer web application and I have a requirement where the report has single page and that report page needs to exported to PDF format on a button click(GENERATE REPORT). is this something achievable from power bi or using power automate flow or any other way? belowenter image description here

1 Answers

Assuming you have this button inside the report page, you can set an event handler for the event "buttonClicked". You get all the event details as parameter in your event handler function. 'buttonClicked' event handler docs

...
report.on("buttonClicked", (event) => {
  if (event.detail.id === "YOUR_BUTTON_ID") {
    // Add your logic to send a request to your backend to consume the Power BI REST APIs
  }
});

You can now consume the report export APIs.
Find the code example here
Note the limitation and considerations of exporting reports to PDF

Related