<?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: Power BI Embedded + Javascript API Report Not Rendering in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/324642#M9591</link>
    <description>&lt;P&gt;I have attempted to implement that below and the report doesn't render now. The iFrame and Power BI loading screen appear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;@model PowerBIEmbedded_AppOwnsData.Models.EmbedConfig

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
&amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"&amp;gt;&amp;lt;/script&amp;gt;  
&amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js" "&amp;gt;&amp;lt;/script&amp;gt;

@if (!string.IsNullOrEmpty(Model.ErrorMessage))
{
    &amp;lt;div id="errorWrapper"&amp;gt;
        &amp;lt;h2&amp;gt;
            Error
        &amp;lt;/h2&amp;gt;
        @Model.ErrorMessage
    &amp;lt;/div&amp;gt;

    return;
}

&amp;lt;h2&amp;gt;Embedded Report&amp;lt;/h2&amp;gt;
&amp;lt;div id="reportContainer"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;script&amp;gt;
    // Read embed application token from Model
    var accessToken = "@Model.EmbedToken.Token";

    // Read embed URL from Model
    var embedUrl = "@Html.Raw(Model.EmbedUrl)";

    // Read report Id from Model
    var embedReportId = "@Model.Id";

    // Get models. models contains enums that can be used.
    var models = window['powerbi-client'].models;

    var Filter1 = {
        $schema: "http://powerbi.com/product/schema#advanced",
        target: {
            table: "PBI Load",
            column: "Annualized Base"
        },
        operator: "GreaterThanOrEqual",
        value: "150000"
    }


    // Embed configuration used to describe the what and how to embed.
    // This object is used when calling powerbi.embed.
    // This also includes settings and options such as filters.
    // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
    var config = {
        type: 'report',
        tokenType: models.TokenType.Embed,
        accessToken: accessToken,
        embedUrl: embedUrl,
        id: embedReportId,
        permissions: models.Permissions.All,
        filters: [Filter1],
        settings: {
            filterPaneEnabled: false,
            navContentPaneEnabled: true
        }
    };

    // Get a reference to the embedded report HTML element
    var reportContainer = $('#reportContainer')[0];

    // Embed the report and display it within the div container.
    var report = powerbi.embed(reportContainer, config);



    

&amp;lt;/script&amp;gt;

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Dec 2017 17:28:13 GMT</pubDate>
    <dc:creator>ats1958</dc:creator>
    <dc:date>2017-12-16T17:28:13Z</dc:date>
    <item>
      <title>Power BI Embedded + Javascript API Report Not Rendering</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/323857#M9557</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm attempting to extend Power BI's "App Owns Data" example to use some Javascript filtering. The code I've added is below. I'm getting a critical Javascript syntax error on line 86, which is the blank line following "filters.push(Filter1);"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="kwd"&gt;var&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Filter1&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;{&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;    $schema&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"http://powerbi.com/product/schema#advanced"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;    target&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;{&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;        table&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"PBI Load"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;        column&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"Business Unit"&lt;/SPAN&gt;
    &lt;SPAN class="pun"&gt;},&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;    logicalOperator&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"OR"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;    conditions&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;
        &lt;SPAN class="pun"&gt;{&lt;/SPAN&gt;
            &lt;SPAN class="kwd"&gt;operator&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"Contains"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;            value&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"Information"&lt;/SPAN&gt;
        &lt;SPAN class="pun"&gt;}&lt;/SPAN&gt;
    &lt;SPAN class="pun"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;}&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;report&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;on&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str"&gt;'loaded'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;event&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;=&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;{&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;    report&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;getFilters&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;()&lt;/SPAN&gt;
        &lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;then&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;filters &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;{&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;            filters&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;push&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Filter1&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;);&lt;/SPAN&gt;

            &lt;SPAN class="kwd"&gt;return&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; report&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;setFilters&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;filters&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;);&lt;/SPAN&gt;
        &lt;SPAN class="pun"&gt;});&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;});&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Dec 2017 20:00:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/323857#M9557</guid>
      <dc:creator>ats1958</dc:creator>
      <dc:date>2017-12-14T20:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Embedded + Javascript API Report Not Rendering</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/324032#M9565</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/49233"&gt;@ats1958&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;The post Javascript portion seems good, I don't find any syntax error by using some &lt;A href="http://esprima.org/demo/validate.html" target="_self"&gt;syntax checker&lt;/A&gt;. Could you post all the javascript code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, you don't have to set filter after report loaded. You can set filter in the report embed configuration. See below demo.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;html&amp;gt;

 &amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"&amp;gt;&amp;lt;/script&amp;gt;
 
&amp;lt;script type="text/javascript"&amp;gt;
window.onload = function () {  &lt;BR /&gt;
var Filter1 = {
 $schema: "http://powerbi.com/product/schema#advanced",
 target: {
 table: "DateTable",
 column: "Date"
 },
 logicalOperator: "And",
 conditions: [{
 operator: "LessThandOrEqual",
 value: "2017-02-20 00:00:00"
 },
 {
 operator: "GreaterThanOrEqual",
 value: "2017-01-12 00:00:00"
 }
 ]
 }

var clientname = ["powerbi"]; 
 
 
    // Read embed application token from Model
    var accessToken = "H4sIAAAAxxxxxx";

    // Read embed URL from Model
    var embedUrl = "https://app.powerbi.com/reportEmbed?reportId=1685axxxxxxxdf3861&amp;amp;groupId=dc581184-a209-xxxxxxx6b6c15";

    // Read report Id from Model
    var embedReportId = "1685a4xxxxxx1df3861";

    // Get models. models contains enums that can be used.
    var models = window['powerbi-client'].models;

    // Embed configuration used to describe the what and how to embed.
    // This object is used when calling powerbi.embed.
    // This also includes settings and options such as filters.
    // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
    var embedConfiguration = {
        type: 'report',
        tokenType: models.TokenType.Embed,
        accessToken: accessToken,
        embedUrl: embedUrl,
        id: embedReportId,
        permissions: models.Permissions.All,
	&lt;FONT size="4"&gt;&lt;STRONG&gt;filters:[Filter1],&lt;/STRONG&gt;&lt;/FONT&gt;
        settings: {
            //filterPaneEnabled: true,
            navContentPaneEnabled: true
        }
    };
  
var $reportContainer = $('#reportContainer');
 
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
 
/** 
report.on('loaded', event =&amp;gt; {
  report.getFilters()
    .then(filters =&amp;gt; {
      filters.push(Filter23);
	   
      return report.setFilters(Filter23);
    });
});  
**/
} 
&amp;lt;/script&amp;gt;

&amp;lt;div id="reportContainer" powerbi-settings-nav-content-pane-enabled="true"   powerbi-settings-filter-pane-enabled="true"&amp;gt;&amp;lt;/div&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 04:26:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/324032#M9565</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-12-15T04:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Embedded + Javascript API Report Not Rendering</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/324642#M9591</link>
      <description>&lt;P&gt;I have attempted to implement that below and the report doesn't render now. The iFrame and Power BI loading screen appear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;@model PowerBIEmbedded_AppOwnsData.Models.EmbedConfig

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
&amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"&amp;gt;&amp;lt;/script&amp;gt;  
&amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js" "&amp;gt;&amp;lt;/script&amp;gt;

@if (!string.IsNullOrEmpty(Model.ErrorMessage))
{
    &amp;lt;div id="errorWrapper"&amp;gt;
        &amp;lt;h2&amp;gt;
            Error
        &amp;lt;/h2&amp;gt;
        @Model.ErrorMessage
    &amp;lt;/div&amp;gt;

    return;
}

&amp;lt;h2&amp;gt;Embedded Report&amp;lt;/h2&amp;gt;
&amp;lt;div id="reportContainer"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;script&amp;gt;
    // Read embed application token from Model
    var accessToken = "@Model.EmbedToken.Token";

    // Read embed URL from Model
    var embedUrl = "@Html.Raw(Model.EmbedUrl)";

    // Read report Id from Model
    var embedReportId = "@Model.Id";

    // Get models. models contains enums that can be used.
    var models = window['powerbi-client'].models;

    var Filter1 = {
        $schema: "http://powerbi.com/product/schema#advanced",
        target: {
            table: "PBI Load",
            column: "Annualized Base"
        },
        operator: "GreaterThanOrEqual",
        value: "150000"
    }


    // Embed configuration used to describe the what and how to embed.
    // This object is used when calling powerbi.embed.
    // This also includes settings and options such as filters.
    // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
    var config = {
        type: 'report',
        tokenType: models.TokenType.Embed,
        accessToken: accessToken,
        embedUrl: embedUrl,
        id: embedReportId,
        permissions: models.Permissions.All,
        filters: [Filter1],
        settings: {
            filterPaneEnabled: false,
            navContentPaneEnabled: true
        }
    };

    // Get a reference to the embedded report HTML element
    var reportContainer = $('#reportContainer')[0];

    // Embed the report and display it within the div container.
    var report = powerbi.embed(reportContainer, config);



    

&amp;lt;/script&amp;gt;

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 17:28:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/324642#M9591</guid>
      <dc:creator>ats1958</dc:creator>
      <dc:date>2017-12-16T17:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Embedded + Javascript API Report Not Rendering</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/325431#M9619</link>
      <description>&lt;P&gt;I have just noticed the following on the console when loading. Does this have to do with the accessToken? Are there additional changes needed when going from AppOwnsData sample to using the JavascriptAPI?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pbi-embedded-error.JPG" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/74722i0FEDFAF8F4ECB2E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="pbi-embedded-error.JPG" alt="pbi-embedded-error.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 17:06:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/325431#M9619</guid>
      <dc:creator>ats1958</dc:creator>
      <dc:date>2017-12-18T17:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Embedded + Javascript API Report Not Rendering</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/325554#M9621</link>
      <description>&lt;P&gt;Update: I receive this slightly different set of console errors when embedding without the filter, though the report renders properly:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="console-pbi.JPG" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/74761iCF8D4FB27611D171/image-size/large?v=v2&amp;amp;px=999" role="button" title="console-pbi.JPG" alt="console-pbi.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 20:25:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/325554#M9621</guid>
      <dc:creator>ats1958</dc:creator>
      <dc:date>2017-12-18T20:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Embedded + Javascript API Report Not Rendering</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/325613#M9624</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&amp;nbsp;Do you have any other thoughts on this?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 22:25:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/325613#M9624</guid>
      <dc:creator>ats1958</dc:creator>
      <dc:date>2017-12-18T22:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Embedded + Javascript API Report Not Rendering</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/4074411#M54491</link>
      <description>&lt;P&gt;do anyone know what is the new links for below&lt;/P&gt;&lt;PRE&gt;&amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Aug 2024 21:38:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Javascript-API-Report-Not-Rendering/m-p/4074411#M54491</guid>
      <dc:creator>DileepRajam</dc:creator>
      <dc:date>2024-08-01T21:38:29Z</dc:date>
    </item>
  </channel>
</rss>

