I have a PowerBI report having 5 different pages. The code below helps me to set a desired page as the default page when the web page I embedded the PowerBI report comes up to my screen.
var report = powerbi.embed(reportContainer, config);
report.on('loaded', () => {
report.getPages().then(pages => pages[3].setActive());
});
Two questions I have at this point that I couldn't find answers:
1- How can I set a page as default by using its exact name instead of the array number? I need to do something like: pages => pages['Overall Summary'].setActive();
2- Is there a way to receive the pages on C#, or pass the ones I am getting to the C#? The reason I ask this that I want to hide some pages based on the user logged in.
Any advice would be appreciated. Thanks!
EDIT: By saying pagename, I meant the tab names at the bottom of the powerBI report, each page has a different name as to been: