2

I'm using a power-bi Embedded report in my webpage.The report have multiple pages. I need to set the default page based on drop-down selection.Is there any query-string parameter i can use for this?

Thanks in advance.

Foxan Ng
  • 6,883
  • 4
  • 34
  • 41
CGN007
  • 131
  • 2
  • 10

1 Answers1

5

There are two ways to do so with the Power BI JavaScript API.

You can change the settings in the embed configuration object and set the default page by specifying the page name.

var embedConfig = {
  ...
  pageName: 'ReportSection3'
};

You can also use the setPage method to set the active page of the report.

report.setPage("page2")
 .catch(error => { ... });

EDIT:

You can also add &pageName=YourPageName to the embed URL to set the default page, i.e. https://app.powerbi.com/view?r=XXXXXXXXXXXXXXX&pageName=YourPageName

Foxan Ng
  • 6,883
  • 4
  • 34
  • 41
  • Sorry i think i didnt get that .. I'm directly refering the powerBI in a Iframe in my MVC .cshtml page ( . Could you please explain how I can implement on this.Thanks – CGN007 Mar 14 '17 at 00:17
  • @CGN007 That's the Power BI JavaScript library which allows your application more interaction with the IFrame. You can check the code and live demo [here](https://microsoft.github.io/PowerBI-JavaScript/demo/code-demo/index.html). I've also added an alternative solution above which uses the query string. Hope it works for you. – Foxan Ng Mar 14 '17 at 00:38