I've successfully integrated a PowerBI report into my Angular7 client application by registering the app with Azure Active Directory (AAD). The embedding process went smoothly, but now I want to enable users of my client app to download and print the embedded report. Below is the Angular7 code snippet that I used to embed the PowerBI report.
showReport() {
// Secure access token for the report
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"
}
}
};
// Get the reference to the HTML div element where the report will be displayed.
let reportContainer = <HTMLElement>document.getElementById('reportContainer');
// Embed the report within the specified 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);
// Remove the "loaded" event handler if it exists.
report.off("loaded");
// Add an event handler to log when the report is loaded.
report.on("loaded", function () {
console.log("Loaded");
});
}
Any suggestions on how can I enable users to download and print the embedded report?