Forum Discussion

Master_T's avatar
Master_T
Helper I
4 years ago
Solved

Embedding API: get list of visuals without embedding entire report?

Helllo everybody

 

I'm developing a web application where I want to embed some single visuals from a report in a web page, using the official powerbi-client library.

 

The problem I am facing is that, in order to embed a visual, I need to know the visual name. So I would like to get the list of visuals in code. However, from what I understand from the documentation, it looks like to do I first need to embed a report, because only then I can get the list of visuals with something like this:

 

let report = embeddedReport.getReport();
let pages = await report.getPages();
pages.forEach(async page => {
  let visuals = await page.getVisuals();
});

 

 

now I have the visuals name and I can use them to embed visuals, however I had to embed a report (that I didn't need) in order to get them.


My question is: is there a way to use the client to get a report and list its visuals without embedding it in the page first? I know I can technically just embed it in an invisible html element and remove it after, however that seems hacky... there must be a more direct way, right?

2 Replies