Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
GSP
Frequent Visitor

To enable Print option for Power Bi reports in our web application in iframes

Hi,

We are embedding our Power Bi reports into our web application in iframes. We used the option File-> Embed Report-> Website or Portal.

Do we have the possibility to enable 'Print' provision using custom JavaScript. If yes then could you please share sample.

Thanks

 

2 REPLIES 2
vishnupawar022
New Member

To enable the print option for Power BI reports embedded in iframes on your web application, you can use JavaScript to interact with the iframe's content. Here's a sample code snippet that demonstrates how you can achieve this: KrogerFeedback

 

CODE:

 

// Find the iframe element by its ID
var iframe = document.getElementById('your-iframe-id');

// Access the content of the iframe
var iframeContent = iframe.contentWindow || iframe.contentDocument;

// Define a function to trigger the print dialog
function printReport() {
iframeContent.print();
}

// Example usage: Attach a click event listener to a button
document.getElementById('print-button').addEventListener('click', printReport);

 

In this code:

 

  • Replace 'your-iframe-id' with the actual ID of your iframe element.
  • Replace 'print-button' with the ID of the button or element that you want to use to trigger the print action.
  • When the button is clicked, the printReport() function will be called, which will trigger the print dialog for the content inside the iframe.
  • Make sure that the iframe source allows printing of its content. Additionally, note that browser security restrictions may apply when trying to access the content of iframes from different domains.
  • Please test this code in your environment and adjust it as needed to fit your specific requirements.

 

Implementation:

 

Identify the ID of the iframe element that contains your embedded Power BI report. Define a JavaScript function that will be responsible for triggering the print action. Attach an event listener to a button or any other element on your webpage. When the button is clicked, call the function that triggers the print action for the iframe's content.

Anonymous
Not applicable

Hi @GSP ,

As far as I concerned, Power BI is now unable to achieve what you need . You can submit an idea for it at   https://ideas.powerbi.com/ideas/   and wait for users with the same needs as you to vote for you to help make it happen as soon as possible.

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors