Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I have an issue where I'm showing a PowerBI report in our custom Angular 8 web application in an IFrame. This was working fine a couple days ago, but now the reports are refreshing/reloading every 10 seconds or so and I cannot figure out why. We have a PBI Premium capacity account and I've looked at every setting possible in app.powerbi.com and on the reports in PBI desktop to no avail. Can anyone thing of a network or application setting that would cause the reports to keep reloading? Thanks so much for any help.
Solved! Go to Solution.
I cant confirm that the same would work in an Angular project... but a React project I have worked on, relied on the component hosting the Embedded Report (IFrame) tracking its own state.
Then, when re-render events occur, the component decides IF the call to embed needs to be made.
By tracking the current report ID/URL and the state of the embedded object (PreLoad/Loading/Rendered) - I could determine if a reload was required. It sounds as though some external events are causing your component to refresh/re-render - and your code is calling back into the embed function - even though it has already completed and doesn't need to be done again.
Wiki page for tracking events is here: https://github.com/microsoft/PowerBI-JavaScript/wiki/Handling-Events
It's difficult to know for sure without seeing the code - but maybe some verbose debugging/console outputs willl help track it down?
Hi @kcross2000
I can't think of any embedding settings that would cause this.
I am not familiar with Angular enough to know if it is the cause - but is it possible it is something in your application that is causing the parent component to re-render?
Otherwise, this comes to mind... https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-automatic-page-refresh
Might be worth checking?
I do have "Page Refresh" off for both reports. I've also still yet to find the issue, but I do think it's something in the web app that's causing this reload/refresh behavior. I know that even in the older version of the web app, if you resize or move a browser window the report would reload. Is there a way to prevent that behavior some how? If so, maybe I can give that a try.
I cant confirm that the same would work in an Angular project... but a React project I have worked on, relied on the component hosting the Embedded Report (IFrame) tracking its own state.
Then, when re-render events occur, the component decides IF the call to embed needs to be made.
By tracking the current report ID/URL and the state of the embedded object (PreLoad/Loading/Rendered) - I could determine if a reload was required. It sounds as though some external events are causing your component to refresh/re-render - and your code is calling back into the embed function - even though it has already completed and doesn't need to be done again.
Wiki page for tracking events is here: https://github.com/microsoft/PowerBI-JavaScript/wiki/Handling-Events
It's difficult to know for sure without seeing the code - but maybe some verbose debugging/console outputs willl help track it down?
I think you are exactly right. I think the new signalR events that are occuring in the background of the web app are triggering some onchange events to the IFrame in which I'm showing the PBI embedded reports. I was able to fix this in Angular by using the changeDetection: ChangeDetectionStrategy.OnPush component option and basically ignoring all event changes in the report component that houses the IFrame. I've attached my code in case anyone else runs in to this. Hope it helps someone. I've bolded the code that is relevant to this issue.
Excellent - glad you managed to find the fix. 😀
User | Count |
---|---|
8 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |