The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi everyone,
I already saw posts with this problem, but all of them was a little old.
I'm embeding my power bi reports in a Angular project. I already can embed and show the report.
But now i want change pages with a button. I already search everywhere and everything i found didn't work.
Anyone with this problem recently?
thank you in advance.
Solved! Go to Solution.
The call to powerBiService.embed(...) will return an object type of pbi.Embed by default.
In the React & Typescript project I am developing with - I can safely cast the output as type 'pbi.Report';
This object then has the function 'getPages' - which is not available on the more generic pbi.Embed object.
report = pbiService.embed(container, embedConfiguration) as pbi.Report;
You can safely cast embed objects to the expected type (Dashboard/Report/Tile) as long as it matches the configuration.
Unfortunately I dont have an Angular project to confirm if there is something else going on.
HI @Marrafeiro
I have this working with a couple of projects, 1 plain JS site - and 1 using React JS.
Assume you have tried something along the lines of the notes in the JavaScript Wiki? https://github.com/Microsoft/PowerBI-JavaScript/wiki/Page-Navigation
One thing to keep in mind is that the page name you need to supply is the internal name and not the page display name.
It is a good idea to use the 'report.GetPages' function in order to get the array of pages, before using one of the array items and setting it to be 'isActive'.
Yes, i already tried it. But it give an error in getPages. Says i'm working in an Embed type.
just for testing i have this:
The call to powerBiService.embed(...) will return an object type of pbi.Embed by default.
In the React & Typescript project I am developing with - I can safely cast the output as type 'pbi.Report';
This object then has the function 'getPages' - which is not available on the more generic pbi.Embed object.
report = pbiService.embed(container, embedConfiguration) as pbi.Report;
You can safely cast embed objects to the expected type (Dashboard/Report/Tile) as long as it matches the configuration.
Unfortunately I dont have an Angular project to confirm if there is something else going on.
Thank you very much. showing your example helped me a lot.
I was missing the casting in Embed object to Report Object.
Now i already can get the pages and change it.
Thank you a lot
Excellent - Glad you got it working!
User | Count |
---|---|
5 | |
3 | |
2 | |
2 | |
2 |
User | Count |
---|---|
11 | |
7 | |
5 | |
4 | |
4 |