Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have created an embed token and obtained the embed URL and report ID. I plug in all the information into the JavaScript Demo site (https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html#) and all works well everytime. But now I am trying to put it into an HTML file to see it run via my own scipt but I get: This content isn't available. Learn more about Power BI.
Also, I have a clientid and clientsecret when I creat my codes, not sure if that make a difference then just using a clientid
Below is the script I am using:
<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: 'report',
accessToken: '[Embed Token]',
embedUrl: '[URL]',
id:'[report id]',
settings: {
filterPaneEnabled: true,
navContentPaneEnabled: false
} };
var $reportContainer = $('#dashboardContainer');
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
}
function reloadreport(){
var element = $('#dashboardContainer');
alert(element);
var report = powerbi.get(element);
report.reload().catch(error => {console.log(error) });
};
</script>
<div id="dashboardContainer">
</div>
</html>
Solved! Go to Solution.
Hi @azulcore,
According to my test, maybe you need to update the token that will expire in one hour.
Best Regards,
Dale
Hi @azulcore,
According to my test, maybe you need to update the token that will expire in one hour.
Best Regards,
Dale
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
2 | |
2 | |
1 | |
1 |