cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
samira
Microsoft
Microsoft

C# code to get pages from each report

Hello all!!

I am playing with the powerBI API and I need help with.

I want to get the meta data from pages of a specific report . My goal is to make API calls to 

ApiUrl/reports/{report-id}/{pagename}, and get meta data from it. Just like we do for reports and dashboards. I have tried the same function without success , got a 404 error. 

Is  it possible?

If not, what other options do I have?

 

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft
Microsoft

Hi @samira,

I want to get the meta data from pages of a specific report . My goal is to make API calls to 

ApiUrl/reports/{report-id}/{pagename}, and get meta data from it. 



If I understand you correctly, you should be able to use the report.getPages function(PowerBI-JavaScript) to get the list of pages within the report, and then use page functions to get the Filters or Visuals or other meta data of each page. Smiley Happy

 

The sample code below is for your reference.

    var report = powerbi.embed(reportContainer, config);

    report.on('loaded', function () {
        report.getPages().then(function (pages) {
            //pages[1].setActive();
page.getFilters().then(filters => { ... }); }); });

 

Regards

View solution in original post

4 REPLIES 4
v-ljerr-msft
Microsoft
Microsoft

Hi @samira,

I want to get the meta data from pages of a specific report . My goal is to make API calls to 

ApiUrl/reports/{report-id}/{pagename}, and get meta data from it. 



If I understand you correctly, you should be able to use the report.getPages function(PowerBI-JavaScript) to get the list of pages within the report, and then use page functions to get the Filters or Visuals or other meta data of each page. Smiley Happy

 

The sample code below is for your reference.

    var report = powerbi.embed(reportContainer, config);

    report.on('loaded', function () {
        report.getPages().then(function (pages) {
            //pages[1].setActive();
page.getFilters().then(filters => { ... }); }); });

 

Regards

View solution in original post

Thank you for the reply!!

 

Are there such functions in c#? 

My app is written in C# and the goal is to get the meta data and add them to a database. 

I will use Javascript after all, thanks for all!

samira
Microsoft
Microsoft

Hello all!!

I am playing with the powerBI API and I need help with.

I want to get the meta data from pages of a specific report . My goal is to make API calls to 

ApiUrl/reports/{report-id}/{pagename}, and get meta data from it. Just like we do for reports and dashboards. I have tried the same function without success , got a 404 error. 

Is  it possible?

If not, what other options do I have?

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Kudoed Authors