<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Avoid report re embedding on route change in Angular in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Avoid-report-re-embedding-on-route-change-in-Angular/m-p/1772956#M28832</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an angular component containing my html container on which the embedding is going to happen. Now on route change, this component is getting destroyed and so does its html container containing the report. When user is getting back to the report route, the component is initializing again and re embedding from scratch the report, removing any changes made from the user to the report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know if there are means to make the report survive it component destruction. I thought about means like making the embedding process happening in a service being called from the component displaying the report. Issue is I do not see how to set that practically and what exactly should the service return : the html container or the result of pbi.embed() method?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is currently the method called from my service onInit of my report viewer component:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.powerbiService
      .getReportEmbedInfoById()
      .subscribe(async (data) =&amp;gt; {
        if (this.pbiContainerElement) {
          const embedConfig = this.powerbiService.buildEmbedConfig(data);
          powerbi.reset(this.pbiContainerElement);
          this.myReport = powerbi.embed(this.pbiContainerElement, embedConfig);
          // report.off removes all event handlers for a specific event
          this.myReport.off('loaded');
          // report.on will add an event handler
          this.myReport.on('loaded', () =&amp;gt; {
            this.powerbiService.handleTokenExpiration(this.myReport);
            loadedResolve();
            // this.myReport.off("loaded");
          });
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks for any support.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Apr 2021 20:11:39 GMT</pubDate>
    <dc:creator>Marco57</dc:creator>
    <dc:date>2021-04-07T20:11:39Z</dc:date>
    <item>
      <title>Avoid report re embedding on route change in Angular</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Avoid-report-re-embedding-on-route-change-in-Angular/m-p/1772956#M28832</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an angular component containing my html container on which the embedding is going to happen. Now on route change, this component is getting destroyed and so does its html container containing the report. When user is getting back to the report route, the component is initializing again and re embedding from scratch the report, removing any changes made from the user to the report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know if there are means to make the report survive it component destruction. I thought about means like making the embedding process happening in a service being called from the component displaying the report. Issue is I do not see how to set that practically and what exactly should the service return : the html container or the result of pbi.embed() method?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is currently the method called from my service onInit of my report viewer component:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.powerbiService
      .getReportEmbedInfoById()
      .subscribe(async (data) =&amp;gt; {
        if (this.pbiContainerElement) {
          const embedConfig = this.powerbiService.buildEmbedConfig(data);
          powerbi.reset(this.pbiContainerElement);
          this.myReport = powerbi.embed(this.pbiContainerElement, embedConfig);
          // report.off removes all event handlers for a specific event
          this.myReport.off('loaded');
          // report.on will add an event handler
          this.myReport.on('loaded', () =&amp;gt; {
            this.powerbiService.handleTokenExpiration(this.myReport);
            loadedResolve();
            // this.myReport.off("loaded");
          });
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks for any support.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 20:11:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Avoid-report-re-embedding-on-route-change-in-Angular/m-p/1772956#M28832</guid>
      <dc:creator>Marco57</dc:creator>
      <dc:date>2021-04-07T20:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid report re embedding on route change in Angular</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Avoid-report-re-embedding-on-route-change-in-Angular/m-p/1778877#M28899</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;HI&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/278723"&gt;@Marco57&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;According to your description, it sounds like you want to avoid the user changes on your report? &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If that is the case, I'd like to suggest you not sharing the 'edit' permission to this report, then changes on this content will be reset when the report reload.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 01:52:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Avoid-report-re-embedding-on-route-change-in-Angular/m-p/1778877#M28899</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-12T01:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid report re embedding on route change in Angular</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Avoid-report-re-embedding-on-route-change-in-Angular/m-p/1780188#M28925</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually want to keep the changes from user to the report as long as they did not ask explicitlly to refresh the report, thus re embedding it and getting the original version of it. I am currently embedding it as view mode only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some temporary changes are being made from the user but when he navigates to another root of the web application embedding the report, then the embedded report is destroyed and embedded again from scratch when user gets back to the report root of the web application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is to find a way to not re start the full embedding process when Angular changes its route to a differente one from within the web application. If the user explicitly refreshed the web application, then it is ok that it embeds a report from scratch, but not on route change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Marc.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 13:13:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Avoid-report-re-embedding-on-route-change-in-Angular/m-p/1780188#M28925</guid>
      <dc:creator>Marco57</dc:creator>
      <dc:date>2021-04-12T13:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid report re embedding on route change in Angular</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Avoid-report-re-embedding-on-route-change-in-Angular/m-p/1786276#M29008</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/278723"&gt;@Marco57&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;So you mean to keep current changes avoid refresh when you change data source?&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If that is the case, you can enable the persistent filter or try to create a global variable to save current filters and restore them to the new report contents after the report refreshed:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/javascript/api/overview/powerbi/enable-persistent-filters" target="_blank"&gt;Enable persistent filters in a Power BI embedded analytics application | Microsoft Docs&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/javascript/api/overview/powerbi/create-edit-report-embed-view?tabs=embed-for-your-customers#save-a-report" target="_blank"&gt;Create, edit, and save an embedded report | Microsoft Docs&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 08:09:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Avoid-report-re-embedding-on-route-change-in-Angular/m-p/1786276#M29008</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-15T08:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid report re embedding on route change in Angular</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Avoid-report-re-embedding-on-route-change-in-Angular/m-p/2327107#M34298</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/278723"&gt;@Marco57&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have the same issue. Can you please share how you were able to resolve it and if the recommendation provided by v-shex-msft worked?&amp;nbsp;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 04:11:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Avoid-report-re-embedding-on-route-change-in-Angular/m-p/2327107#M34298</guid>
      <dc:creator>sdk1990</dc:creator>
      <dc:date>2022-02-09T04:11:00Z</dc:date>
    </item>
  </channel>
</rss>

