<?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 Js Api Example From GitHub in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Js-Api-Example-From-GitHub/m-p/348773#M10336</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/53438"&gt;@oflok000&lt;/a&gt;,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;I was learning Power Bi Js Api from github and then when I start make my example. I got this problem&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-01-30 at 4.39.26 PM.png" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/79934i775346321D847F05/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-01-30 at 4.39.26 PM.png" alt="Screen Shot 2018-01-30 at 4.39.26 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;this is my Code. (I am using angular. &lt;STRONG&gt;I took access code,url,id from sample form github&lt;/STRONG&gt;)&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The access token, url, id from the sample won't work in your application/code. You need to use &lt;STRONG&gt;your own&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;access token, url, id. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So you have to&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;create Power BI account, and upload your reports to the created account. Then, you can call Power BI APIs to &lt;STRONG&gt;generate Embed Token&lt;/STRONG&gt; for reports, dashboards or tiles you want to embed. For more information about embedding entities using Embed Tokens, please visit&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedding-content" rel="nofollow" target="_blank"&gt;Embed Token Documentation&lt;/A&gt;&lt;SPAN&gt;.&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;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jan 2018 07:59:34 GMT</pubDate>
    <dc:creator>v-ljerr-msft</dc:creator>
    <dc:date>2018-01-31T07:59:34Z</dc:date>
    <item>
      <title>Power Bi Js Api Example From GitHub</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Js-Api-Example-From-GitHub/m-p/348460#M10327</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I was learning Power Bi Js Api from github and then when I start make my example. I got this problem&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-01-30 at 4.39.26 PM.png" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/79934i775346321D847F05/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-01-30 at 4.39.26 PM.png" alt="Screen Shot 2018-01-30 at 4.39.26 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this is my Code. (I am using angular. I took access code,url,id from sample form github)&lt;/P&gt;&lt;PRE&gt;// app/app.component.ts

import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import * as pbi from 'powerbi-client';


declare const $; 

@Component({
  selector: 'app-root',
  templateUrl:'app.component.html',
  styles: [``]
})
export class AppComponent implements OnInit {
    
    constructor(private http: HttpClient){}
    
    ngOnInit(){ 
        
        this.showReport();
            
    }
    
    showReport() {
    // Report's Secured Token
    let accessToken = 'H4sIAAAAAAAEAB2Wxw6shhJE_-VusUSGwZIX5JwzOzJDzsl6__5G3vei-6iquv79Y6VPP6XFn7__NBYvBIOr0ykKgg-FRvn-3Pa5iS1JnzN7fgswUIA8b96PLi660L_XS9HsrY9ULGBGnPeAWRJNB7jWCUgvuTlqEejfGk6f5iTlzWUfz3FAATeQqbg7eQqL-nPazEfJIf-qqdelQs5YsOV0bls9ZrrkPpmn-22p8L2BBAv8kuUjgcON3Cyo04rMGWZDAnGHlEjr9H2rYm9PV7OFaM4q9VRRV4RTQwE_468LlmJhPlE0iS6zPvz1yVF6t7NbldPkk-ZpnJ5QQxZfJJ4lSUF4Frf381xC4_OwLkJ6tjaMfGQxWEryO9IA41SQ7pxKmIFRDV5_n_dMUBUEo-AaGDM7eA_VJ6CC_DSuFW4N2kJvZZCvY5ydylmwb8qMmVTKX4VzaL5UY7lexoZi-O9UVUIXa9rAVA6KDYN_X8iTLGulhKUjswSrsiWeoZtOvZ-qn3feRmM_wbdWDWPponRcyRbHcOgvTABtglDi3lMOlyXN4KbrgQURy4PO-Og2gYAJVvmmYQAw2gEOj2idj7Yw8txPEe1msF-F6fqUzA9s2ps5EIHy9cRsfZ9YF7EkbZgvSNcZ5UBfNMkP7a63BZmkogg2KJHECG0oed9prPWxdWQNRh1W3OixEipITnYww-ZmSZMc_20vzoVcfwozcwwDu1H6AjJyB5gWlTBOUqFhYrdCCOBbKMvXqRkJtO4N1QJcId3usQNES19Xz5W6n0rEVf4mlYIJ0ZCQmXNadCGqF2EC6-fVEqWbWt0zeYWEBF4BHGRVZ6dLFQgduoafQdm9376-JNTNo_3IXNeqUhC948eZ89bURBMBl51g6di-Zsoh9Fub_OerPL6U2DIgk9Z8AOPm-xtR2uY3vQlo-ImsaT_QcqfiEgZH289SXjmZPJ8q--a2KNvjzcTugnDz48lYxGkoODTqs0UNLaog5R7CmXAEG3RJvk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YWeF5pvs5qaDZMHqN3awzWCpAbYBNwC7zDT3-o6B5onQkTxB4fpHIcm4nvTNI-lY8LNvmEBSZc8_XL98-evP-z6zPukls-vOig6tuuiOkTwdH4VjHnGysmRDRJCwqnwm7DoPg43yAu4ofWwwYNXyBK-R0wqhuMKtUqcsc8N28PjZqltsRonWv6RglQaZA55HsAN-QN13m3yzSaDWqWIy-FWXty7TNtcimH1FaeW2PK0p7DbInaDBXPTDzdHBJPuInd2ZWnmViQDYiXKhmHPltcro7BUQN4WdqitaLFAGr3MeWd3UZJzxl2AVFjFxYdEMcAUPU8QpYkiSCzqTngrdQtWY865m_4uiwhOtIaNp4UH0vFZGHyCRG5nGXugg1jnhkqMwFC2zYKCRoymfyWinQfZ5oj5vUWncuINqOgccAlcJsPakG4fXXzK_uc_zM_c_JQe_Ci_CcwQUYhPTicXMb3sz7SV9H9T7rce0_1Yy99YbSCveGoiCeiomSTyOQEg-woG24FTMuCMgoCIo-NPhaJyYnHuV3hXz-Oo5Fdq4qdU3XZwgktJdnOlagzDhpPzgXUVkO6R_Dyfsh1LNk0f10WMnSgaY3b-TN13LGT1CO8M9xKBaveFuaAH6MMPilcE_80CxPe7wcFx_A7FmuJIs2WcWuNzkX6R5zIJcjr64YBioneeeUq06vWS7maPrbmTJOJHeAIH_vekoVanXe9m0hg19-SXaGHIWDoo81HTfj19pXgzl5e2uFdsGmTnumJkssqLDIZMPFA89gZYchMw-GSVdEdNptIIA5Z4mGHY5BXhuehxS3hVz06Psl6rJBiU92uqP8z_-z8oE56sLgsAAA==';

    // Embed URL
    let embedUrl = 'https://app.powerbi.com/reportEmbed?reportId=bd851208-5592-4e3e-ba72-5cfdfc39f41c&amp;amp;groupId=9166cf8d-d5fc-405e-bdc7-47e414da08fe';

    // Report ID
    let embedReportId = 'bd851208-5592-4e3e-ba72-5cfdfc39f41c';

    var models = pbi.models;
 
// We give All permissions to demonstrate switching between View and Edit mode and saving report.
    var permissions = models.Permissions.All
        
    // 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.
    let config= {
    type: 'report',
    //tokenType: tokenType == '0' ? models.TokenType.Aad : models.TokenType.Embed,
    accessToken: accessToken,
    embedUrl: embedUrl,
    id: embedReportId,
    permissions: permissions,
    settings: {
        filterPaneEnabled: true,
        navContentPaneEnabled: true
    }
}

    // Grab the reference to the div HTML element that will host the report.
    let reportContainer = &amp;lt;HTMLElement&amp;gt;document.getElementById('reportContainer');

    // Embed the report and display it within the div container.
    let powerbi = new pbi.service.Service(pbi.factories.hpmFactory, pbi.factories.wpmpFactory, pbi.factories.routerFactory);
    let report = powerbi.embed(reportContainer, config);

        console.log(report);
        
    // Report.off removes a given event handler if it exists.
    report.off("loaded");

    // Report.on will add an event handler which prints to Log window.
    report.on("loaded", function() {
        console.log("Loaded");
    });
}

        
    
}&lt;/PRE&gt;&lt;P&gt;I alredy try everithing but I have no idea why my code doesnt work. It's the same code what they have&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 21:44:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Js-Api-Example-From-GitHub/m-p/348460#M10327</guid>
      <dc:creator>oflok000</dc:creator>
      <dc:date>2018-01-30T21:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi Js Api Example From GitHub</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Js-Api-Example-From-GitHub/m-p/348773#M10336</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/53438"&gt;@oflok000&lt;/a&gt;,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;I was learning Power Bi Js Api from github and then when I start make my example. I got this problem&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-01-30 at 4.39.26 PM.png" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/79934i775346321D847F05/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-01-30 at 4.39.26 PM.png" alt="Screen Shot 2018-01-30 at 4.39.26 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;this is my Code. (I am using angular. &lt;STRONG&gt;I took access code,url,id from sample form github&lt;/STRONG&gt;)&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The access token, url, id from the sample won't work in your application/code. You need to use &lt;STRONG&gt;your own&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;access token, url, id. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So you have to&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;create Power BI account, and upload your reports to the created account. Then, you can call Power BI APIs to &lt;STRONG&gt;generate Embed Token&lt;/STRONG&gt; for reports, dashboards or tiles you want to embed. For more information about embedding entities using Embed Tokens, please visit&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedding-content" rel="nofollow" target="_blank"&gt;Embed Token Documentation&lt;/A&gt;&lt;SPAN&gt;.&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;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 07:59:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Js-Api-Example-From-GitHub/m-p/348773#M10336</guid>
      <dc:creator>v-ljerr-msft</dc:creator>
      <dc:date>2018-01-31T07:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi Js Api Example From GitHub</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Js-Api-Example-From-GitHub/m-p/349066#M10354</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Thank you for respond. Actually I can use any accesss tokken&amp;nbsp;my tokken was embed but I found example with access code.&lt;/P&gt;&lt;P&gt;This link&amp;nbsp;&lt;A href="https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad" target="_blank"&gt;https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad&lt;/A&gt; return json with access code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 14:28:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Js-Api-Example-From-GitHub/m-p/349066#M10354</guid>
      <dc:creator>oflok000</dc:creator>
      <dc:date>2018-01-31T14:28:33Z</dc:date>
    </item>
  </channel>
</rss>

