<?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 Re: saveAsTriggered not firing for Save As in Embedded in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/saveAsTriggered-not-firing-for-Save-As-in-Embedded/m-p/2934838#M40023</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/385096"&gt;@gotters&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am so glad that you could solve your issue by yourself. Please kindly Accept your workaround as the solution. More people will benefit from it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Nov 2022 07:27:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-11-29T07:27:10Z</dc:date>
    <item>
      <title>saveAsTriggered not firing for Save As in Embedded</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/saveAsTriggered-not-firing-for-Save-As-in-Embedded/m-p/2933622#M40007</link>
      <description>&lt;P&gt;The SaveAsTriggered event is not firing for me when embedding a report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even in the playground I cant get it to fire.&lt;/P&gt;&lt;P&gt;Is there something obvious that I am missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try the following code in playground:&lt;/P&gt;&lt;P&gt;&lt;A href="https://playground.powerbi.com/en-us/dev-sandbox" target="_blank" rel="noopener"&gt;https://playground.powerbi.com/en-us/dev-sandbox&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Embed a Power BI report in the given HTML element with the given configurations
// Read more about how to embed a Power BI report in your application here: https://go.microsoft.com/fwlink/?linkid=2153590
function embedPowerBIReport() {
/*-----------------------------------------------------------------------------------+
| Don't change these values here: access token, embed URL and report ID. |
| To make changes to these values: |
| 1. Save any other code changes to a text editor, as these will be lost. |
| 2. Select 'Start over' from the ribbon. |
| 3. Select a report or use an embed token. |
+-----------------------------------------------------------------------------------*/
// Read embed application token
let accessToken = EMBED_ACCESS_TOKEN;

// Read embed URL
let embedUrl = EMBED_URL;

// Read report Id
let embedReportId = REPORT_ID;

// Read embed type from radio
let tokenType = TOKEN_TYPE;

// We give All permissions to demonstrate switching between View and Edit mode and saving report.
let permissions = models.Permissions.All;

// Create the embed configuration object for the report
// For more information see https://go.microsoft.com/fwlink/?linkid=2153590
let config = {
type: 'report',
tokenType: tokenType == '0' ? models.TokenType.Aad : models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: embedReportId,
permissions: permissions,
settings: {
panes: {
filters: {
visible: true
},
pageNavigation: {
visible: true
}
}
}
};

// Get a reference to the embedded report HTML element
let embedContainer = $('#embedContainer')[0];

// Embed the report and display it within the div container.
report = powerbi.embed(embedContainer, config);

// report.off removes all event handlers for a specific event
report.off("loaded");

// report.on will add an event handler
report.on("loaded", function () {
loadedResolve();
report.off("loaded");
});

// report.off removes all event handlers for a specific event
report.off("error");

report.on("error", function (event) {
console.log(event.detail);
});

// report.off removes all event handlers for a specific event
report.off("rendered");

// report.on will add an event handler
report.on("rendered", function () {
renderedResolve();
report.off("rendered");
});
}

embedPowerBIReport();
await reportLoaded;

// Insert here the code you want to run after the report is loaded

await reportRendered;

// Switch to edit mode.
report.switchMode("edit");

// Insert here the code you want to run after the report is rendered
// report.off removes all event handlers for a specific event
report.off("saveAsTriggered");

// report.on will add an event listener.
report.on("saveAsTriggered", function (event) {
console.log(event);
});

// Select Run and then select SaveAs.
// You should see an entry in the Log window.

console.log("Select SaveAs to see events in Log window.");&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 28 Nov 2022 19:00:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/saveAsTriggered-not-firing-for-Save-As-in-Embedded/m-p/2933622#M40007</guid>
      <dc:creator>gotters</dc:creator>
      <dc:date>2022-11-28T19:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: saveAsTriggered not firing for Save As in Embedded</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/saveAsTriggered-not-firing-for-Save-As-in-Embedded/m-p/2934012#M40015</link>
      <description>&lt;P&gt;Figured it out. I needed to modify the embed config to include&lt;BR /&gt;settings: {&lt;BR /&gt;useCustomSaveAsDialog: true&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Then you do need to use your own Save As Modal but then at least the saveAsTriggered will fire!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 22:22:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/saveAsTriggered-not-firing-for-Save-As-in-Embedded/m-p/2934012#M40015</guid>
      <dc:creator>gotters</dc:creator>
      <dc:date>2022-11-28T22:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: saveAsTriggered not firing for Save As in Embedded</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/saveAsTriggered-not-firing-for-Save-As-in-Embedded/m-p/2934838#M40023</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/385096"&gt;@gotters&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am so glad that you could solve your issue by yourself. Please kindly Accept your workaround as the solution. More people will benefit from it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 07:27:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/saveAsTriggered-not-firing-for-Save-As-in-Embedded/m-p/2934838#M40023</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-29T07:27:10Z</dc:date>
    </item>
  </channel>
</rss>

