User Profile
erosal84
Regular Visitor
Joined 6 years ago
User Widgets
Contributions
How to do a "save as" on embedded API report?
I'm able to embed a Power BI report in my app: <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 the 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 = $('#embedContainer')[0]; // Embed the report and display it within the div container. var report = powerbi.embed(reportContainer, config); </script> I want to creata a "save as" button on the page with the embedded report to save a new copy of the report into the workspace, but I'm at a loss as to how to code the javascript in my cshtml. Does anyone have an example they'd be willing to share?519Views0likes0CommentsPower BI Embedded API ExportToFile returns "Forbidden" error
I'm trying to do an ExportToFile on a report I have displayed in my app using the Power BI Embedded API. I am using the same code to get token credentials and generate a Power BI Embedded API client object that is working when I display my report, but when I try to call Clent.Reports.ExportToFIleInGroupsAsync, it throws a "Forbidden" exception. var exportRequest = new ExportReportRequest { Format = format, PowerBIReportConfiguration = powerBIReportExportConfiguration }; // Get token credentials for user var getCredentialsResult = await GetTokenCredentials(); if (!getCredentialsResult) { // The error message set in GetTokenCredentials return null; } var Client = new PowerBIClient(new Uri(ApiUrl), m_tokenCredentials); var export = await Client.Reports.ExportToFileInGroupAsync(groupId, reportId, exportRequest); Any thoughts on what I'm doing wrong? -- Tony1KViews1like2CommentsPower BI Embedded API - How to export a filtered report?
My application displays a Power BI report from my workspace via the Power BI Embedded API. My user has clicked an element of a bar chart visualization, which automatically filters the data on the other visualizations accordingly. Now, she wants to export that filtered view to a PDF. I've seen the code examples for doing an export to file, but that seems to imply just exporting the base report from the workspace. How do I export the current view of the report, as filtered by the user?Solved4KViews0likes5Comments
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.