Closed Trakhan closed 9 months ago
I have the same issue: when I change the report URL by passing it down from the parent component the state is updated in
Currently this is not implemented in powerbi-client-angular package
.
As a workaround, you can try implementing the below code in your application to reset the container.
// Create a service
const powerbi = new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory);
// Reset the container
powerbi.reset(document.getElementsByClassName("report-container")[0] as HTMLElement);
We'll look into this request of adding the reset
functionality in the Angular package
Thanks, I will try that. For now I am completely removing powerbi-report component and adding it anew, which works as well. Might by however less optimal.
powerbi.reset(document.getElementsByClassName("report-container")[0] as HTMLElement);
By using this.reportObject.powerbi.reset(document.getElementsByClassName("report-container")[0] as HTMLElement);
I get this errore: "can't access property "powerBiEmbed", powerBiElement is null"
Hi it works for me. Currently I'm using something like this:
// Create a service
const powerbi = new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory);
// Reset the container
powerbi.reset(document.getElementsByClassName('report-container')[0] as HTMLElement);
this.reportConfig = this.createAnotherReportConfig();
// Embed anew
powerbi.embed(document.getElementsByClassName('report-container')[0] as HTMLElement, this.reportConfig);
Note: 'report-container' class name is what is passed to powerbi-report with cssClassName input.
This way of resetting report breaks eventHandlers mapping.
Issue submitter approved solution, closing this issue as resolved.
Hello.
According to https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/mobile#limitations we should call powerbi.reset(HTMLElement) on report container.
How can something simmilar be achieved with angular powerbi-report component?
Thanks.