<?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: Embedded Reports error if multiple objects are embedded on a page in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Embedded-Reports-error-if-multiple-objects-are-embedded-on-a/m-p/471595#M14474</link>
    <description>&lt;P&gt;I am using this below code to embed the report into web application.&lt;/P&gt;&lt;P&gt;When pageName parameter is set to default page of the report, it shows only that page.&lt;/P&gt;&lt;P&gt;When we set the pageName to other page names in the report, it still shows the default page name only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pageName and below settings together won't work?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;pageName: '&lt;/SPAN&gt;&lt;SPAN&gt;Page3&lt;/SPAN&gt;&lt;SPAN&gt;',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;settings: {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;filterPaneEnabled: false,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;navContentPaneEnabled: false&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;script src="~/jquery-1.9.1.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script src="~/adal.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script src="~/powerbi.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;BR /&gt;(function() {&lt;BR /&gt;&lt;BR /&gt;"use strict";&lt;BR /&gt;&lt;BR /&gt;var subscriptionId = 'tenantname.onmicrosoft.com';&lt;BR /&gt;// Copy the client ID of your AAD app here once you have registered one, configured the required permissions, and&lt;BR /&gt;// allowed implicit flow&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="" href="https://msdn.microsoft.com/en-us/office/office365/howto/get-started-with-office-365-unified-api" target="_blank" rel="nofollow noopener noreferrer"&gt;https://msdn.microsoft.com/en-us/office/office365/howto/get-started-with-office-365-unified-api&lt;/A&gt;&lt;BR /&gt;var clientId = 'guid';&lt;BR /&gt;var config = {&lt;BR /&gt;subscriptionId: subscriptionId,&lt;BR /&gt;clientId: clientId,&lt;BR /&gt;postLogoutRedirectUri: window.location.origin,&lt;BR /&gt;resource: '&lt;A title="" href="https://analysis.windows.net/powerbi/api" target="_blank" rel="nofollow noopener noreferrer"&gt;https://analysis.windows.net/powerbi/api&lt;/A&gt;',&lt;BR /&gt;prompt: 'none',&lt;BR /&gt;cacheLocation: 'localStorage', // enable this for IE, as sessionStorage does not work for localhost.&lt;BR /&gt;embedUrlBase: '&lt;A title="" href="https://app.powerbi.com/reportEmbed" target="_blank" rel="nofollow noopener noreferrer"&gt;https://app.powerbi.com/reportEmbed&lt;/A&gt;',&lt;BR /&gt;reportId: 'guid of dashboard',&lt;BR /&gt;groupId: 'guid of group',&lt;BR /&gt;response_type:'id_token'&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;// AuthenticationContext is coming from ADAL.min.js&lt;BR /&gt;var authContext = new AuthenticationContext(config);&lt;BR /&gt;&lt;BR /&gt;// Check For &amp;amp; Handle Redirect From AAD After Login&lt;BR /&gt;var isCallback = authContext.isCallback(window.location.hash);&lt;BR /&gt;&lt;BR /&gt;authContext.handleWindowCallback();&lt;BR /&gt;if (isCallback &amp;amp;&amp;amp; !authContext.getLoginError()) {&lt;BR /&gt;window.location = authContext._getItem(authContext.CONSTANTS.STORAGE.LOGIN_REQUEST);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// If not logged in force login&lt;BR /&gt;var user = authContext.getCachedUser();&lt;BR /&gt;&lt;BR /&gt;if (!user) {&lt;BR /&gt;//alert('user login required');&lt;BR /&gt;authContext.login();&lt;BR /&gt;//alert('user login completed');&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Acquire token for resource.&lt;BR /&gt;authContext.acquireToken(config.resource, function(error, token) {&lt;BR /&gt;// alert('acquireToken fn called');&lt;BR /&gt;// Handle ADAL Errors.&lt;BR /&gt;if (error || !token) {&lt;BR /&gt;alert('ADAL error occurred: ' + error);&lt;BR /&gt;console.log('ADAL error occurred: ' + error);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Store our token&lt;BR /&gt;config.authToken = token;&lt;BR /&gt;&lt;BR /&gt;$(document).ready(function(){&lt;BR /&gt;&lt;BR /&gt;var models = window['powerbi-client'].models;&lt;/P&gt;&lt;P&gt;// Embed configuration used to describe the what and how to embed.&lt;BR /&gt;// This object is used when calling powerbi.embed.&lt;BR /&gt;// This also includes settings and options such as filters.&lt;BR /&gt;// You can find more information at&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="" href="https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;var embedUrl = "&lt;A title="" href="https://app.powerbi.com/dashboardEmbed?dashboardId=%22+" target="_blank" rel="nofollow noopener noreferrer"&gt;https://app.powerbi.com/dashboardEmbed?&lt;SPAN&gt;reportId&lt;/SPAN&gt;="+&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;config.&lt;SPAN&gt;reportId&lt;/SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;// alert(embedUrl);&lt;BR /&gt;var pbiconfig = {&lt;BR /&gt;type: 'report',&lt;BR /&gt;tokenType: models.TokenType.Aad,&lt;BR /&gt;accessToken: config.authToken,&lt;BR /&gt;embedUrl: embedUrl,&lt;BR /&gt;id: config.&lt;SPAN&gt;reportId&lt;/SPAN&gt;,&lt;BR /&gt;pageView: 'fitToWidth',&lt;/P&gt;&lt;P&gt;pageName: 'Page3',&lt;BR /&gt;settings: {&lt;BR /&gt;filterPaneEnabled: false,&lt;BR /&gt;navContentPaneEnabled: false&lt;BR /&gt;}&lt;BR /&gt;};&lt;BR /&gt;var pbiconfigmessage = JSON.stringify(pbiconfig);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Get a reference to the embedded dashboard HTML element&lt;BR /&gt;var dashboardContainer = $('#divDashBoardContainer')[0];&lt;/P&gt;&lt;P&gt;// Embed the dashboard and display it within the div container.&lt;BR /&gt;var dashboard = powerbi.embed(dashboardContainer, pbiconfig);&lt;BR /&gt;&lt;BR /&gt;// Get a reference to the embedded dashboard.&lt;BR /&gt;var dashboard1 = powerbi.get(dashboardContainer);&lt;/P&gt;&lt;P&gt;// Displays the dashboard in full screen mode.&lt;BR /&gt;dashboard1.fullscreen();&lt;BR /&gt;// push the message.&lt;BR /&gt;// iframe.contentWindow.postMessage(message, "*");;&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;});&lt;BR /&gt;})();&lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div id="divDashBoardContainer" style="height:758px; border-style: double; border-color: aqua; border-width: thick; "&amp;gt;&amp;lt;/div&amp;gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jul 2018 12:04:51 GMT</pubDate>
    <dc:creator>Yaostha</dc:creator>
    <dc:date>2018-07-25T12:04:51Z</dc:date>
    <item>
      <title>Embedded Reports error if multiple objects are embedded on a page</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embedded-Reports-error-if-multiple-objects-are-embedded-on-a/m-p/314901#M9321</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to embed multiple reports in a single web page. When I do so the "dataSelected" and "rendered" events do not work. If I embed a single report then all is well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I add an embedded tile or dashboard with a report this causes the same problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just doing the following, twice for two different reports (or once for a report, and then again for a dashbaord/tile):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var pbi = powerbi.embed(pbicontainer, config);&lt;/P&gt;&lt;P&gt;pbi.on("dataSelected", function(){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert();&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;pbi.on("rendered", function(){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert();&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have two report, only the second fires events.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I add a Tile instead I can capture an error in tile.ts on the line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let messageData = JSON.parse(event.data);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;event.data is an object, it looks like a response as it has properties like body, headers, method url etc. The body has dataPoint, filters etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks a bit like the "message" event is being captured by all Power BI javascript objects, but this is a bit of a guess, I've not gone hunting through the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone repo this or is there a solution? Please let me know if any more detail is required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Colin&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 18:17:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embedded-Reports-error-if-multiple-objects-are-embedded-on-a/m-p/314901#M9321</guid>
      <dc:creator>teroman</dc:creator>
      <dc:date>2017-11-30T18:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded Reports error if multiple objects are embedded on a page</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embedded-Reports-error-if-multiple-objects-are-embedded-on-a/m-p/315227#M9327</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/7815"&gt;@teroman&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to embed multiple reports in a single web page. When I do so the "dataSelected" and "rendered" events do not work. If I embed a single report then all is well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I add an embedded tile or dashboard with a report this causes the same problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm just doing the following, twice for two different reports (or once for a report, and then again for a dashbaord/tile):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var pbi = powerbi.embed(pbicontainer, config);&lt;/P&gt;
&lt;P&gt;pbi.on("dataSelected", function(){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert();&lt;BR /&gt;});&lt;/P&gt;
&lt;P&gt;pbi.on("rendered", function(){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert();&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I have two report, only the second fires events.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I add a Tile instead I can capture an error in tile.ts on the line&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let messageData = JSON.parse(event.data);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;event.data is an object, it looks like a response as it has properties like body, headers, method url etc. The body has dataPoint, filters etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks a bit like the "message" event is being captured by all Power BI javascript objects, but this is a bit of a guess, I've not gone hunting through the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone repo this or is there a solution? Please let me know if any more detail is required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Colin&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/7815"&gt;@teroman&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;At this moment, embedding dashboards only supports the events&amp;nbsp;&lt;SPAN&gt;tileClicked and error&lt;/SPAN&gt;, see &lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/issues/267" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;As to&amp;nbsp;"&lt;SPAN&gt;If I have two report, only the second fires events.&lt;/SPAN&gt;", I don't reproduce that issue, could you post more code?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 05:52:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embedded-Reports-error-if-multiple-objects-are-embedded-on-a/m-p/315227#M9327</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-12-01T05:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded Reports error if multiple objects are embedded on a page</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embedded-Reports-error-if-multiple-objects-are-embedded-on-a/m-p/315538#M9339</link>
      <description>&lt;P&gt;Hi Eric,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for taking a look at this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to repro and of course my reduced example worked just fine! Got stuck into the debugger and found it was because my divs didn't have id attributes. When embedding Power BI uses the id to decide if the embed is going into the same element.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can work around for now by assigning a random id to the div, I don't know if you'd want to fix this or at least call out the requirement in the docs. There the examples have an id, but don't state it is mandatory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function where the problem occurs: (powerbi-client v2.4.2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  addOrOverwriteEmbed(component: embed.Embed, element: HTMLElement): void {
    // remove embeds over the same div element.
    this.embeds = this.embeds.filter(function(embed) {
      return embed.element.id !== element.id;
    });

    this.embeds.push(component);
  }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Full Example:&lt;/P&gt;&lt;PRE&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta http-equiv="x-ua-compatible" content="IE=Edge"&amp;gt;
    &amp;lt;script src="../Js/promise.min.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;!--PM&amp;gt; Install-Package Microsoft.PowerBI.JavaScript--&amp;gt;
    &amp;lt;script src="../scripts/powerbi.min.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
        function loadPowerBIReport(embedUrl, accessToken, div){

            var models = window['powerbi-client'].models;

            var view = models.ViewMode.View;
            var display = models.DisplayOption.FitToPage;
            var filterPane = false;
            var navPane = false;
            var tokenType = models.TokenType.Aad;
            var type = "report";

            var config = {
                view: view,
                displayOption: display,
                type: type,
                tokenType: tokenType,
                accessToken: accessToken,
                embedUrl: embedUrl,
                settings:{
                    filterPaneEnabled:filterPane,
                    navContentPaneEnabled:navPane
                }
            };

            report = powerbi.embed(div, config);

            //report.on("filtersApplied", function(){ });
            report.on("dataSelected", function(e){
                alert("dataSelected!");
            });

            report.on("rendered", function(event){
                alert("rendered!");
            });
        }
        
        window.onload = function(){
            var accessToken = "my token";
            var report1 = "https://app.powerbi.com/reportEmbed?reportId=some guid";
            var report2 = "https://app.powerbi.com/reportEmbed?reportId=another guid";
            var divs = document.body.querySelectorAll("div")
            var div1 = divs[0];
            var div2 = divs[1];
            loadPowerBIReport(report1, accessToken, div1);
            loadPowerBIReport(report2, accessToken, div2);
        }
    &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
    &amp;lt;div style="height:500px;width:500px"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div style="height:500px;width:500px"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Dec 2017 10:00:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embedded-Reports-error-if-multiple-objects-are-embedded-on-a/m-p/315538#M9339</guid>
      <dc:creator>teroman</dc:creator>
      <dc:date>2017-12-01T10:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded Reports error if multiple objects are embedded on a page</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embedded-Reports-error-if-multiple-objects-are-embedded-on-a/m-p/471595#M14474</link>
      <description>&lt;P&gt;I am using this below code to embed the report into web application.&lt;/P&gt;&lt;P&gt;When pageName parameter is set to default page of the report, it shows only that page.&lt;/P&gt;&lt;P&gt;When we set the pageName to other page names in the report, it still shows the default page name only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pageName and below settings together won't work?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;pageName: '&lt;/SPAN&gt;&lt;SPAN&gt;Page3&lt;/SPAN&gt;&lt;SPAN&gt;',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;settings: {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;filterPaneEnabled: false,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;navContentPaneEnabled: false&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;script src="~/jquery-1.9.1.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script src="~/adal.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script src="~/powerbi.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;BR /&gt;(function() {&lt;BR /&gt;&lt;BR /&gt;"use strict";&lt;BR /&gt;&lt;BR /&gt;var subscriptionId = 'tenantname.onmicrosoft.com';&lt;BR /&gt;// Copy the client ID of your AAD app here once you have registered one, configured the required permissions, and&lt;BR /&gt;// allowed implicit flow&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="" href="https://msdn.microsoft.com/en-us/office/office365/howto/get-started-with-office-365-unified-api" target="_blank" rel="nofollow noopener noreferrer"&gt;https://msdn.microsoft.com/en-us/office/office365/howto/get-started-with-office-365-unified-api&lt;/A&gt;&lt;BR /&gt;var clientId = 'guid';&lt;BR /&gt;var config = {&lt;BR /&gt;subscriptionId: subscriptionId,&lt;BR /&gt;clientId: clientId,&lt;BR /&gt;postLogoutRedirectUri: window.location.origin,&lt;BR /&gt;resource: '&lt;A title="" href="https://analysis.windows.net/powerbi/api" target="_blank" rel="nofollow noopener noreferrer"&gt;https://analysis.windows.net/powerbi/api&lt;/A&gt;',&lt;BR /&gt;prompt: 'none',&lt;BR /&gt;cacheLocation: 'localStorage', // enable this for IE, as sessionStorage does not work for localhost.&lt;BR /&gt;embedUrlBase: '&lt;A title="" href="https://app.powerbi.com/reportEmbed" target="_blank" rel="nofollow noopener noreferrer"&gt;https://app.powerbi.com/reportEmbed&lt;/A&gt;',&lt;BR /&gt;reportId: 'guid of dashboard',&lt;BR /&gt;groupId: 'guid of group',&lt;BR /&gt;response_type:'id_token'&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;// AuthenticationContext is coming from ADAL.min.js&lt;BR /&gt;var authContext = new AuthenticationContext(config);&lt;BR /&gt;&lt;BR /&gt;// Check For &amp;amp; Handle Redirect From AAD After Login&lt;BR /&gt;var isCallback = authContext.isCallback(window.location.hash);&lt;BR /&gt;&lt;BR /&gt;authContext.handleWindowCallback();&lt;BR /&gt;if (isCallback &amp;amp;&amp;amp; !authContext.getLoginError()) {&lt;BR /&gt;window.location = authContext._getItem(authContext.CONSTANTS.STORAGE.LOGIN_REQUEST);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// If not logged in force login&lt;BR /&gt;var user = authContext.getCachedUser();&lt;BR /&gt;&lt;BR /&gt;if (!user) {&lt;BR /&gt;//alert('user login required');&lt;BR /&gt;authContext.login();&lt;BR /&gt;//alert('user login completed');&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Acquire token for resource.&lt;BR /&gt;authContext.acquireToken(config.resource, function(error, token) {&lt;BR /&gt;// alert('acquireToken fn called');&lt;BR /&gt;// Handle ADAL Errors.&lt;BR /&gt;if (error || !token) {&lt;BR /&gt;alert('ADAL error occurred: ' + error);&lt;BR /&gt;console.log('ADAL error occurred: ' + error);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Store our token&lt;BR /&gt;config.authToken = token;&lt;BR /&gt;&lt;BR /&gt;$(document).ready(function(){&lt;BR /&gt;&lt;BR /&gt;var models = window['powerbi-client'].models;&lt;/P&gt;&lt;P&gt;// Embed configuration used to describe the what and how to embed.&lt;BR /&gt;// This object is used when calling powerbi.embed.&lt;BR /&gt;// This also includes settings and options such as filters.&lt;BR /&gt;// You can find more information at&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="" href="https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;var embedUrl = "&lt;A title="" href="https://app.powerbi.com/dashboardEmbed?dashboardId=%22+" target="_blank" rel="nofollow noopener noreferrer"&gt;https://app.powerbi.com/dashboardEmbed?&lt;SPAN&gt;reportId&lt;/SPAN&gt;="+&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;config.&lt;SPAN&gt;reportId&lt;/SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;// alert(embedUrl);&lt;BR /&gt;var pbiconfig = {&lt;BR /&gt;type: 'report',&lt;BR /&gt;tokenType: models.TokenType.Aad,&lt;BR /&gt;accessToken: config.authToken,&lt;BR /&gt;embedUrl: embedUrl,&lt;BR /&gt;id: config.&lt;SPAN&gt;reportId&lt;/SPAN&gt;,&lt;BR /&gt;pageView: 'fitToWidth',&lt;/P&gt;&lt;P&gt;pageName: 'Page3',&lt;BR /&gt;settings: {&lt;BR /&gt;filterPaneEnabled: false,&lt;BR /&gt;navContentPaneEnabled: false&lt;BR /&gt;}&lt;BR /&gt;};&lt;BR /&gt;var pbiconfigmessage = JSON.stringify(pbiconfig);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Get a reference to the embedded dashboard HTML element&lt;BR /&gt;var dashboardContainer = $('#divDashBoardContainer')[0];&lt;/P&gt;&lt;P&gt;// Embed the dashboard and display it within the div container.&lt;BR /&gt;var dashboard = powerbi.embed(dashboardContainer, pbiconfig);&lt;BR /&gt;&lt;BR /&gt;// Get a reference to the embedded dashboard.&lt;BR /&gt;var dashboard1 = powerbi.get(dashboardContainer);&lt;/P&gt;&lt;P&gt;// Displays the dashboard in full screen mode.&lt;BR /&gt;dashboard1.fullscreen();&lt;BR /&gt;// push the message.&lt;BR /&gt;// iframe.contentWindow.postMessage(message, "*");;&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;});&lt;BR /&gt;})();&lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div id="divDashBoardContainer" style="height:758px; border-style: double; border-color: aqua; border-width: thick; "&amp;gt;&amp;lt;/div&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 12:04:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embedded-Reports-error-if-multiple-objects-are-embedded-on-a/m-p/471595#M14474</guid>
      <dc:creator>Yaostha</dc:creator>
      <dc:date>2018-07-25T12:04:51Z</dc:date>
    </item>
  </channel>
</rss>

