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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Save visual from Page.GetVisuals as image

I am using the PowerBI JS API to get reports and visuals. So far using the function below gives the title of the visuals and the visuals in svg tags.

report.getPages() .then(function (pages) {

// Retrieve first page.

var firstPage = pages[0];

firstPage.getVisuals() 

 .then(function (visuals) {

console.log(visuals); }) })

 

I want to download each visual as an image and save them to my PC. 

Any one has a solution? 

I've tried many methods without success 

3 REPLIES 3
jorge-gt3
Regular Visitor

@Anonymous, where you able to this? I need the same functionality, which is fairly simple if we could get the visual's HTML code. 

 

@v-jiascu-msft those are not feasible workarounds given that cross-domain iFame access is not permitted. But we could use the postMessage Communication Flow if there was an event that would return the HTML code of the visual instead of the current JSON response. 

 

 

Anonymous
Not applicable

no I wasn't able to do it. 

v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

This function just gives us a text list of all the visuals. Since the visuals aren't ordinary images, the workaround I can think of could be loading these viusals one by one and print them out. Please refer to 

1. using-html5-canvas-javascript-to-take-in-browser-screenshots/

2. https://stackoverflow.com/questions/9616426/javascript-print-iframe-contents-only/9616706

 

 

Best Regards,

Dale

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.