Forum Discussion
Print an embed Report
- 1 year ago
Hi v-ssriganesh ,
Not really, I wanted to capture the snapshot of embedded report on click of button , so that if user has put any slicer value then also I can fetch image of Report(Filtered one).
This is still not achieved. I'm trying the NODE-JS sample code provided by Microsoft.
Hi lovishsood1
You're trying to print a web page that contains an embedded Power BI report (using the powerbi-client library in React), but the printed output is blank where the Power BI report should appear. This happens because embedded Power BI reports are rendered within an iframe using dynamic JavaScript and cross-origin content, which standard browser print mechanisms (and tools like html2canvas) struggle to capture. html2canvas, for instance, cannot render iframe contents due to browser security restrictions (CORS policy), which leads to blank areas in the generated print or screenshot.
To work around this, consider using Power BI's native "Export to PDF" or "Export to PPTX" capabilities via the Power BI REST API or the Export button in the Power BI report itself, if available. Another option is to programmatically export the visual/report to a PDF on the server side, using a service principal or embed token with export permissions, and then render or print that PDF within your React app. If you absolutely need to print the full webpage with embedded visuals, one workaround is to capture the report area separately (e.g., via a screenshot tool that supports CORS iframes or by calling Power BI’s exportToFile API), and inject the image into the DOM before printing. Unfortunately, pure front-end solutions like html2canvas or standard browser print won't work reliably with embedded Power BI content due to how it's sandboxed for security.