<?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 createReport does not expose same API as embed in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/createReport-does-not-expose-same-API-as-embed/m-p/1995766#M30894</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am embedding a new report using the `powerbi.createReport` function.&lt;BR /&gt;The embed works fine - but I cannot access functions such as `getPages()` on the returned object.&lt;/P&gt;&lt;P&gt;It appears the returned object is a very lackluster compared to the one returned by `embed()`.&lt;/P&gt;&lt;P&gt;Is that intentional?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I expected to have mostly the same API available as when editing an existing report - given the user can add pages, add visuals and do other operations just fine within the iframe - even before the report is saved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I need to save the report first, then embed it - to get access to the needed functionality.&lt;/P&gt;&lt;P&gt;Perhaps I am missing something, but I failed to find any docs or samples regarding working with a new report from code.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Luke&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Aug 2021 15:50:21 GMT</pubDate>
    <dc:creator>lukepaw</dc:creator>
    <dc:date>2021-08-03T15:50:21Z</dc:date>
    <item>
      <title>createReport does not expose same API as embed</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/createReport-does-not-expose-same-API-as-embed/m-p/1995766#M30894</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am embedding a new report using the `powerbi.createReport` function.&lt;BR /&gt;The embed works fine - but I cannot access functions such as `getPages()` on the returned object.&lt;/P&gt;&lt;P&gt;It appears the returned object is a very lackluster compared to the one returned by `embed()`.&lt;/P&gt;&lt;P&gt;Is that intentional?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I expected to have mostly the same API available as when editing an existing report - given the user can add pages, add visuals and do other operations just fine within the iframe - even before the report is saved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I need to save the report first, then embed it - to get access to the needed functionality.&lt;/P&gt;&lt;P&gt;Perhaps I am missing something, but I failed to find any docs or samples regarding working with a new report from code.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Luke&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 15:50:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/createReport-does-not-expose-same-API-as-embed/m-p/1995766#M30894</guid>
      <dc:creator>lukepaw</dc:creator>
      <dc:date>2021-08-03T15:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: createReport does not expose same API as embed</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/createReport-does-not-expose-same-API-as-embed/m-p/1999860#M30926</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/317717"&gt;@lukepaw&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Here I found a post with similar problem like yours and I hope it could help you.&lt;/P&gt;
&lt;P&gt;Try this code:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;var report = powerbi.embed(reportContainer, config); 
report.on("rendered", function (event) { // do stuff here like get pages, export data, apply filters or whatever it is you want to do to manipulate the report 
report.getPages().then((pages) =&amp;gt; { pages[0].getVisuals().then((visuals) =&amp;gt; (d = visuals)); }); var v = d[1].exportData(models.ExportDataType.Summarized, 100); }); &lt;/LI-CODE&gt;
&lt;P&gt;For more details:&amp;nbsp;&lt;A class="" href="https://stackoverflow.com/questions/62653132/not-getting-report-getpages-in-embedded-power-bi-report" target="_blank" rel="noopener"&gt;Not getting report.getPages in Embedded Power BI report&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;For reference:&amp;nbsp;&lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/wiki/Handling-Events" target="_self" rel="nofollow noreferrer"&gt;Handling Events&lt;/A&gt;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 09:42:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/createReport-does-not-expose-same-API-as-embed/m-p/1999860#M30926</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-05T09:42:58Z</dc:date>
    </item>
  </channel>
</rss>

