Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
umutgulac
Frequent Visitor

How to embed a PBI report into our web app where data is in SSAS

 

Under File directory, we couldnt find "Publish to Web" option. Is it because we prefered "online" connection option?

 

We try to get report from a web (php) application; as guided in this link

* We registered our app in Azure AD. We coded in our PHP webapp.

* We got the authorization code and acess token.

* We got the report list over PBI API with the response for report id and embed url.

 

We cannot fetch data from embed url. What may be the possible cause?

 

We also tried to test over here; but since we coulnt figure outthe embed code; we couldnt test over there? How to find the embed code?

1 REPLY 1
Eric_Zhang
Employee
Employee


@umutgulac wrote:

 

Under File directory, we couldnt find "Publish to Web" option. Is it because we prefered "online" connection option?

 

We try to get report from a web (php) application; as guided in this link

* We registered our app in Azure AD. We coded in our PHP webapp.

* We got the authorization code and acess token.

* We got the report list over PBI API with the response for report id and embed url.

 

We cannot fetch data from embed url. What may be the possible cause?

 

We also tried to test over here; but since we coulnt figure outthe embed code; we couldnt test over there? How to find the embed code?


@umutgulac

The here link is a demo of Power BI Javascript for Power BI Embedded. However you can still apply the Javascript API to embed the reports from Power BI Service in your case. Since you've figured out how to get the accesstoken and embed url, to embed a report with them, you can reference below html demo.

 

<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: 'report',
	//replace your token here
    accessToken: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJ.................BwzM733Q',
	
	//replace your reportid here
	id: '057f230b-015e-4c86-ac98-55e82baf363a',
	//replace your embedUrl here
    embedUrl: 'https://app.powerbi.com/reportEmbed?reportId=057f230b-015e-4c86-ac98-55e82baf363a' 

}; 
 

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

<div id="reportContainer" ></div>

</html>

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.