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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SuperUserLendl
Regular Visitor

Moving my Power BI embedded report from the sample application to my customer's application

I have the customer's application registered on Azure, and it is up and running being embedded to the sample application.  I am not a developer and cannot find step by step instructions of loading the report into an application other than the sample.  What do I need to do when I am actually on site with the customer and their website?

 

Do I enter their website information into my Visual Studio project and run it, if so, where?  Do I use the applications URL/URI?  Do I actually interject code into their application to accept / pull in the report?  

 

I understand the code below is used to load the report into a div container.  If someone could tell me exactly how to use this to go from the sample app to my customer's website it would make my week.  Where in the sample code do you associate the website to embed to?  How does the sample code even know to go to the sample application?

 

<script src="~/scripts/powerbi.js"></script>
<div id="reportContainer"></div>
<script>
// Read embed application token from Model
var accessToken = "@Model.EmbedToken.Token";

// Read embed URL from Model
var embedUrl = "@Html.Raw(Model.EmbedUrl)";

// Read report Id from Model
var embedReportId = "@Model.Id";

// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;

// Embed configuration used to describe 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.
var config = {
type: 'report',
tokenType: models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: embedReportId,
permissions: models.Permissions.All,
settings: {
filterPaneEnabled: true,
navContentPaneEnabled: true
}
};

// Get a reference to the embedded report HTML element
var reportContainer = $('#reportContainer')[0];

// Embed the report and display it within the div container.
var report = powerbi.embed(reportContainer, config);
</script>

 

 

My embedded report in the sample appMy embedded report in the sample app

 

 

THANK YOU!

0 REPLIES 0

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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