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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
AJose
Helper I
Helper I

Not able to Export power bi embedded report to PDF

Hi, 

I am trying to export power bi embedded report to PDF, but no luck. I am calling the below JQuery code from Sharepoint 2013.

Any help is appreciated.

 

$.ajax({
url: "https://api.powerbi.com/v1.0/myorg/groups/'" + groupId + "'/reports/'" + reportId + "'/exports/'" + exportId + "'/file"
,type: "GET",
dataType: "json",
headers: {
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"Authorization": "Bearer'" + EmbedToken + "'"
}
}).done(function (data) {
// If successful
console.log(data);
}).fail(function (jqXHR, textStatus, errorThrown) {
// If fail
console.log("Export failed :" + errorThrown);
});

5 REPLIES 5
Greg_Deckler
Super User
Super User

@AJose - Are you getting a specific error?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Hi,

Let me explain the issue in detail. I have a Web API with the code in the below URL which is called form the SharePoint 2013 page using JQuery . I am getting the error - "Netwok error"

 

"https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to"

 

I also tried a second approach by calling the Web API to get the export ID and use the JQuery code in my first post to get the PDF file . I could get the exportId from the Web API but the export to PDF is failing with a blank error.

 

Hope this explanation helps.

Hi @AJose ,

 

Since it is preview, there seems to be an unknown problem with the functions that have not yet been officially launched. I suggest try to open a support ticket. If you have a Pro account it is free. Go to https://support.powerbi.com. Scroll down and click "CREATE SUPPORT TICKET".

 

Best Regards,

Dedmon Dai

Hi, Let me explain the issue in detail. I have a Web API with the code in the below URL which is called form the SharePoint 2013 page using JQuery . I am getting the error - "Netwok error" https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to JQuery Code *************** function ExportPowerBIReport() { var data = { "reportId": reportId, "groupId": groupId, "applicationId":applicationId }; $.ajax({ type: "POST", url: "App Service URL /api/Controller Name/ExportPowerBIReport", async: false, data: JSON.stringify(data), headers: { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose"} }).done(function (data) { // If successful console.log("Export successful"); }).fail(function (jqXHR, textStatus, errorThrown) { // If fail console.log("Export failed :" + errorThrown); }); } I also tried a second approach by calling the Web API to get the export ID and use the JQuery code in my first post to get the PDF file . I could get the exportId from the Web API but the export to PDF is failing with a blank error. Hope this explanation helps.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.