2

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

Jambal
  • 65
  • 6

1 Answers1

2

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

Anant_Kumar
  • 764
  • 1
  • 7
  • 23
  • 1
    The link for the code example you have shared says the feature is in preview but the Power BI rest API documentation at https://learn.microsoft.com/en-us/rest/api/power-bi/reports/export-to-file-in-group doesn't mention that. Is this feature is in preview or GA? – PNDev Sep 22 '21 at 12:35