gui0704
gui0704

Reputation: 11

PowerBI how to get the visuals data in an embeded report with powerbi javascript api

As I success embed a report to html div container, now I want to get the report data(or the visuals data of the report page),is it available through the Power BI JavaScript SDK API?

Upvotes: 0

Views: 1218

Answers (1)

javi0unavailable
javi0unavailable

Reputation: 59

To get a list of visuals in a specific page, use the getVisuals async method on Page object.

page.getVisuals().then(function(visuals) {
  ...
});

Example: get a list of visuals on the first page:

report.getPages()
  .then(function (pages) {
    // Retrieve first page.
    var firstPage = pages[0];

    firstPage.getVisuals()
      .then(function (visuals) {
        console.log(visuals);
      })
  })

https://github.com/Microsoft/PowerBI-JavaScript/wiki/Get-Visuals

But having a look on the object hierarchy you can not do much (https://github.com/Microsoft/PowerBI-JavaScript/wiki/Understanding-the-object-hierarchy) PowerBI-JavaScript Object Hierachy

Upvotes: 1

Related Questions