<?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: config pageName, load/render functions in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/config-pageName-load-render-functions/m-p/354349#M10537</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/51177"&gt;@m4pv&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description above, I have tested it a few times. The default page option in config works fine for me without any issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the value set for the pageName should be real report name(but &lt;STRONG&gt;not&lt;/STRONG&gt; the &lt;STRONG&gt;d&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;isplay name&lt;/STRONG&gt; of the report page&lt;/SPAN&gt;) which you can find from the report url on Power BI service.&lt;/P&gt;
&lt;PRE&gt;https://app.powerbi.com/groups/7d855170-da1f-43aa-9c40-475f7d84ff4c/reports/9622bdcd-eef4-4ec1-880f-3916bb7d471c/&lt;STRONG&gt;ReportSection&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;In addition, if the issue persists, I would suggest you create a new issue &lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/issues" target="_self"&gt;here&lt;/A&gt; for better assistance.&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2018 07:18:02 GMT</pubDate>
    <dc:creator>v-ljerr-msft</dc:creator>
    <dc:date>2018-02-08T07:18:02Z</dc:date>
    <item>
      <title>config pageName, load/render functions</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/config-pageName-load-render-functions/m-p/352833#M10507</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, we need to display the first page of the embedded reports (PowerBI Embedded, App owns data).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I used two methods described below and these both worked fine for some time. But it seems that&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;these methods do not work consistently. We've noticed that after deploying code to web server the first page of the reports&amp;nbsp;is not always opened first. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I also tried locally in .Net code and have the same issue.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1st way: using&amp;nbsp;pageName in config where defaultPageName is a variable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="3"&gt; var models = window['powerbi-client'].models;
 var config = {
        &lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;pageName: defaultPageName,&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;
        type: 'report',
        tokenType: models.TokenType.Embed,
        accessToken: embedToken,
        embedUrl: embedUrl,
        id: embedReportId,
        permissions: models.Permissions.All,
        settings: {
            filterPaneEnabled: false,
            navContentPaneEnabled: true
        }
    };
    var reportContainer = pageDocument.getElementById('reportContainer');
    var report = powerbi.embed(reportContainer, config);&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2nd way: using&amp;nbsp;load/render functionality as defined in&amp;nbsp;&lt;A href="https://powerbi.microsoft.com/en-us/blog/power-bi-developer-community-january-update/" target="_blank"&gt;https://powerbi.microsoft.com/en-us/blog/power-bi-developer-community-january-update/&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where pageIndex&amp;nbsp;&lt;SPAN&gt;is a variable:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="3"&gt;&amp;nbsp;var config = {&lt;BR /&gt; type: 'report',&lt;BR /&gt; tokenType: models.TokenType.Embed,&lt;BR /&gt; accessToken: embedToken,&lt;BR /&gt; embedUrl: embedUrl,&lt;BR /&gt; id: embedReportId,&lt;BR /&gt; permissions: models.Permissions.All,&lt;BR /&gt; settings: {&lt;BR /&gt; filterPaneEnabled: false,&lt;BR /&gt; navContentPaneEnabled: true&lt;BR /&gt; }&lt;BR /&gt; };&lt;BR /&gt; var reportContainer = pageDocument.getElementById('reportContainer');&lt;BR /&gt; var report = powerbi.load(reportContainer, config);    &lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;STRONG&gt;report.on('loaded'&lt;/STRONG&gt;&lt;/FONT&gt;, function () {
        report.getPages()
            .then(function (pages) {
                if (pages[pageIndex].isActive == false) {
                    pages[pageIndex].setActive()
                    .catch(function (errors) {
                        Log.log(errors);
                    });
                }
            })
            .catch(function (errors) {
                Log.log(errors);
            });
        &lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;STRONG&gt;report.render&lt;/STRONG&gt;(config);&lt;/FONT&gt;
    });&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone else&amp;nbsp;have similar issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 19:34:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/config-pageName-load-render-functions/m-p/352833#M10507</guid>
      <dc:creator>m4pv</dc:creator>
      <dc:date>2018-02-06T19:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: config pageName, load/render functions</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/config-pageName-load-render-functions/m-p/354349#M10537</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/51177"&gt;@m4pv&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description above, I have tested it a few times. The default page option in config works fine for me without any issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the value set for the pageName should be real report name(but &lt;STRONG&gt;not&lt;/STRONG&gt; the &lt;STRONG&gt;d&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;isplay name&lt;/STRONG&gt; of the report page&lt;/SPAN&gt;) which you can find from the report url on Power BI service.&lt;/P&gt;
&lt;PRE&gt;https://app.powerbi.com/groups/7d855170-da1f-43aa-9c40-475f7d84ff4c/reports/9622bdcd-eef4-4ec1-880f-3916bb7d471c/&lt;STRONG&gt;ReportSection&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;In addition, if the issue persists, I would suggest you create a new issue &lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/issues" target="_self"&gt;here&lt;/A&gt; for better assistance.&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 07:18:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/config-pageName-load-render-functions/m-p/354349#M10537</guid>
      <dc:creator>v-ljerr-msft</dc:creator>
      <dc:date>2018-02-08T07:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: config pageName, load/render functions</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/config-pageName-load-render-functions/m-p/354684#M10554</link>
      <description>&lt;P&gt;&amp;nbsp;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/11689"&gt;@v-ljerr-msft&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The problem with 1st method was indeed the fact that i was assigning .displaName to config.pageName and not the .name value.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Is there a way to either set actual tab names (in pbi desktop or pbi service) or get them programmatically prior loading the report object? Getting these from url is not an option.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I don't see what was&amp;nbsp;the issue with 2nd method (load / render / pages[0].isActive / pages[0].setActive() functions). Perhaps it's related to&amp;nbsp;&lt;A title="bug" href="https://github.com/Microsoft/PowerBI-JavaScript/issues/311" target="_blank"&gt;this&lt;/A&gt;&amp;nbsp;bug. So for now i just get a real name value and use it to add to config:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="2"&gt;    report.on('loaded', function () {
        report.getPages()
            .then(function (pages) {
&lt;STRONG&gt;                config.pageName = pages[pageIndex].name
                report.render(config);&lt;/STRONG&gt;
            })
            .catch(function (errors) {
                Log.log(errors);
            });
    });&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class=""&gt;Hopefully that will work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 13:30:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/config-pageName-load-render-functions/m-p/354684#M10554</guid>
      <dc:creator>m4pv</dc:creator>
      <dc:date>2018-02-08T13:30:45Z</dc:date>
    </item>
  </channel>
</rss>

