<?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 Calling getPages() in Angular 4  gives error in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Calling-getPages-in-Angular-4-gives-error/m-p/405083#M12084</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to embed a specific page on report load in Angular 4.&lt;/P&gt;&lt;P&gt;I am using the following snippet to get pages of the report so that i can then choose a specific page out of those. I don't want to hard code the page name.&lt;/P&gt;&lt;PRE&gt; this.report.on('loaded', function () {
              this.report.getPages().then(function (pages) {
                                pages[1].setActive();
              });
                        });&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Error Received:&amp;nbsp;&lt;/STRONG&gt;ERROR TypeError: Cannot read property 'getPages' of undefined&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me in resolving it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Prateek Raina&lt;/P&gt;</description>
    <pubDate>Thu, 26 Apr 2018 11:56:45 GMT</pubDate>
    <dc:creator>prateekraina</dc:creator>
    <dc:date>2018-04-26T11:56:45Z</dc:date>
    <item>
      <title>Calling getPages() in Angular 4  gives error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Calling-getPages-in-Angular-4-gives-error/m-p/405083#M12084</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to embed a specific page on report load in Angular 4.&lt;/P&gt;&lt;P&gt;I am using the following snippet to get pages of the report so that i can then choose a specific page out of those. I don't want to hard code the page name.&lt;/P&gt;&lt;PRE&gt; this.report.on('loaded', function () {
              this.report.getPages().then(function (pages) {
                                pages[1].setActive();
              });
                        });&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Error Received:&amp;nbsp;&lt;/STRONG&gt;ERROR TypeError: Cannot read property 'getPages' of undefined&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me in resolving it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Prateek Raina&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 11:56:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Calling-getPages-in-Angular-4-gives-error/m-p/405083#M12084</guid>
      <dc:creator>prateekraina</dc:creator>
      <dc:date>2018-04-26T11:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calling getPages() in Angular 4  gives error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Calling-getPages-in-Angular-4-gives-error/m-p/406080#M12108</link>
      <description>&lt;P&gt;The error messages seems a little odd.&lt;/P&gt;&lt;P&gt;Have you installed the&amp;nbsp;&lt;SPAN&gt;Microsoft.PowerBI.JavaScript package?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://github.com/Microsoft/PowerBI-JavaScript" target="_blank"&gt;https://github.com/Microsoft/PowerBI-JavaScript&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Besides, try:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt; report.on('loaded', () =&amp;gt; {
        report.getPages().then(pages =&amp;gt; pages[1].setActive());
    });&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Developer/set-active-page-in-report-with-JavaScript-API/td-p/93716" target="_self"&gt;Reference&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Michael&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 14:35:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Calling-getPages-in-Angular-4-gives-error/m-p/406080#M12108</guid>
      <dc:creator>v-micsh-msft</dc:creator>
      <dc:date>2018-04-27T14:35:27Z</dc:date>
    </item>
  </channel>
</rss>

