I have created PowerBI report and It has been embedded to my angular7 client application by registering the application with Azure Active Directory(AAD). It embeds perfectly. I want to allow that embedded report to be downloaded, printed by the user of my client application. Following is my Angulr7 code to embed the PowerBI report.
showReport() {
// Report's Secured Token
let accessToken = 'myAccessToken';
// Embed URL
let embedUrl = 'embedUrl';
// Report ID
let embedReportId = 'embedReportId';
let config = {
type: 'report',
accessToken: accessToken,
embedUrl: embedUrl,
id: embedReportId,
settings: {
localeSettings: {
language: "en",
formatLocale: "es"
}
}
};
// Grab the reference to the div HTML element that will host the report.
let reportContainer = <HTMLElement>document.getElementById('reportContainer');
// Embed the report and display it within the div container.
let powerbi = new pbi.service.Service(pbi.factories.hpmFactory, pbi.factories.wpmpFactory, pbi.factories.routerFactory);
let report = powerbi.embed(reportContainer, config);
var rep = powerbi.get(reportContainer);
// Report.off removes a given event handler if it exists.
report.off("loaded");
// Report.on will add an event handler which prints to Log window.
report.on("loaded", function () {
console.log("Loaded");
});
}
How can I achieve this?