Quantcast
Channel: All Developer posts
Viewing all articles
Browse latest Browse all 49170

Re: Integrate Power Bi DASHBOARD with AngularJS not REPORT

$
0
0

401 indicates a unauthorized error, is the token in your case valid? Below sample actually works. For testing purpose, you can get a valid token in a quick way. Just replace the token and dashboardid in your case.

 

<html><script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script><script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script><script type="text/javascript">
window.onload = function () {
var embedConfiguration = {
    type: 'dashboard', // change report to dashboard
    accessToken: 'yourTokenHere',
//change report embed url to dashboard embed url
    embedUrl: 'https://app.powerbi.com/dashboardEmbed?dashboardId=yourdashboardid'  
}; 

var $reportContainer = $('#dashboardContainer');
 
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
 
}
 
 
</script> <div id="dashboardContainer"></div></html>  

Capture.PNG


Viewing all articles
Browse latest Browse all 49170


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>