cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tondeli Regular Visitor
Regular Visitor

Where can I find embedd URL for my report from workspace collection?

I have managed to follow tutorial from this website: https://docs.microsoft.com/en-us/azure/power-bi-embedded/power-bi-embedded-get-started-sample

 

What I'm wondering is that where do I find the code to use when embedding my report to my own application.

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator Eric_Zhang
Moderator

Re: Where can I find embedd URL for my report from workspace collection?


@tondeli wrote:

I have reportID.

 

I tried to use this tutorial https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-integrate-report-code/ but I had no luck.


@tondeli

Supposing that you know how to get the token and reportID from backend. In frontend, you can check below html demo. To get an valid embedurl in Power BI Embedded, you just concatenate "https://embedded.powerbi.com/appTokenReportEmbed?reportId=" and your reportID.

 

 

<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',
    accessToken: 'eyJ0eXAiOiJKV1QxxxxxxxxxxxxxxxiOiJlbWJlxxxxxbjRQQkkiLCJ3aWQiOiJiN2NmNDMzYi00MzdjLTRjYTUtOWRmMi1kOWZkODIxODI0NjEiLCJyaWQiOiJhMzQwMDQ5YS03ZjJiLTQyZDAtOWQwZC0yMGJhMjRjMmUyMGIiLCJ1c2VybmFtZSI6IjEwMDA4NSIsInJvbGVzIjoicHJvdmlkZXIiLCJpc3MiOiJQb3dlckJJU0RLIiwiYXVkIjoiaHR0cHM6Ly9hbmFseXNpcy53aW5kb3dzLm5ldC9wb3dlcmJpL2FwaSIsImV4cCI6MTQ5NTA4OTgyMCwibmJmIjoxNDk1MDg2MjIwfQ.qWpnXkM-C1t8xQEYX90WD6fUJMBBYBUNfgLAicFcd7I',
    embedUrl: 'https://embedded.powerbi.com/appTokenReportEmbed?reportId=a340049a-7xxxxx0d-20ba24c2e20b' 

}; 
 

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

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

</html>

 

 

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Where can I find embedd URL for my report from workspace collection?

I believe that what you really need is to get the Report ID and my understanding is that you do that through code.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

tondeli Regular Visitor
Regular Visitor

Re: Where can I find embedd URL for my report from workspace collection?

I have reportID.

 

I tried to use this tutorial https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-integrate-report-code/ but I had no luck.

Moderator Eric_Zhang
Moderator

Re: Where can I find embedd URL for my report from workspace collection?


@tondeli wrote:

I have reportID.

 

I tried to use this tutorial https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-integrate-report-code/ but I had no luck.


@tondeli

Supposing that you know how to get the token and reportID from backend. In frontend, you can check below html demo. To get an valid embedurl in Power BI Embedded, you just concatenate "https://embedded.powerbi.com/appTokenReportEmbed?reportId=" and your reportID.

 

 

<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',
    accessToken: 'eyJ0eXAiOiJKV1QxxxxxxxxxxxxxxxiOiJlbWJlxxxxxbjRQQkkiLCJ3aWQiOiJiN2NmNDMzYi00MzdjLTRjYTUtOWRmMi1kOWZkODIxODI0NjEiLCJyaWQiOiJhMzQwMDQ5YS03ZjJiLTQyZDAtOWQwZC0yMGJhMjRjMmUyMGIiLCJ1c2VybmFtZSI6IjEwMDA4NSIsInJvbGVzIjoicHJvdmlkZXIiLCJpc3MiOiJQb3dlckJJU0RLIiwiYXVkIjoiaHR0cHM6Ly9hbmFseXNpcy53aW5kb3dzLm5ldC9wb3dlcmJpL2FwaSIsImV4cCI6MTQ5NTA4OTgyMCwibmJmIjoxNDk1MDg2MjIwfQ.qWpnXkM-C1t8xQEYX90WD6fUJMBBYBUNfgLAicFcd7I',
    embedUrl: 'https://embedded.powerbi.com/appTokenReportEmbed?reportId=a340049a-7xxxxx0d-20ba24c2e20b' 

}; 
 

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

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

</html>

 

 

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 359 members 3,901 guests
Please welcome our newest community members: