Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all,
when I send reports via subscription the receiver gets it in .png file and a link to the report. isnt it possible to send the report in pdf?
Thanks.
Solved! Go to Solution.
Hi , @Pikachu-Power
According to my research,common report does not support pdf subscription.
You could try to use email subscribtion with paginated reports.(Requires Premium license)
For more details ,you can refer to these articles.
https://docs.microsoft.com/en-us/power-bi/consumer/paginated-reports-subscriptions
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Greg_Deckler ,
Could you please let me know on how to Automatically Export Power BI Report in PDF with the help of Power Automate and Power BI REST API.
It would be very helpful for us.
Thanks in Advance
Prakash
This is the API call to use:
https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofile
You would use Flow (Power Automate) to implement this by calling a PowerShell script, etc. I'm not super up on Flow but you can ask in the Power Automate forums. You would then use the Flow to send the generated file.
Hi @Greg_Deckler ,
Thanks for your reply.
I tried to Export to PDF with the below code but was getting 1 or more errors.
Invoke-PowerBIRestMethod -Method POST -Url reports/76746e90-02e9-4677-ac7a-0ea5755c6c47/ExportTo -Body PDF -OutFile PDF
Could you or anybody else please help me out in this code? I would like to export it in pdf.
Thanks
Prakash
I believe the correct code is closer to:
$params = @{"format"="PDF"}
Invoke-PowerBIRestMethod -Method POST -Url reports/a9b01471-0982-4e14-bbf7-ddb60a89ab43/ExportTo -Body $params
However, I am getting some kind of Write error:
Invoke-PowerBIRestMethod : One or more errors occurred.
At line:1 char:1
+ Invoke-PowerBIRestMethod -Method POST -Url reports/a9b01471-0982-4e14 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIR
estMethod], AggregateException
+ FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod
Hi @Greg_Deckler ,
Thanks for your reply. I am also getting the same error.
It would be really helpful if any body help me out on the below code.
$params = @{"format"="PDF"}
Invoke-PowerBIRestMethod -Method POST -Url reports/a9b01471-0982-4e14-bbf7-ddb60a89ab43/ExportTo -Body $params
Regards,
Prakash
Well, this is what I am seeing but I know I have full Admin access to this workspace so I don't know why I am getting 403 Forbidden. @Anonymous @v-easonf-msft @rpatkar @Pikachu-Power @Jayendran @Mariusz @edhans @parry2k @VasTg @az38 @HotChilli
Anyone know why this doesn't work? I would be happy with a simple PNG export at this point.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\WINDOWS\system32> cd \temp
PS C:\temp> Connect-PowerBIServiceAccount
Environment : Public
TenantId :
UserName : gdeckler@fusionalliance.com
PS C:\temp> Invoke-PowerBIRestMethod -Method POST -Url reports/4557598e-158d-407e-90e5-35a08b7c7584/ExportTo
WARNING: The Body parameter was null, the request may be invalid when Method parameter is Post.
Invoke-PowerBIRestMethod : One or more errors occurred.
At line:1 char:1
+ Invoke-PowerBIRestMethod -Method POST -Url reports/4557598e-158d-407e ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIR
estMethod], AggregateException
+ FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod
PS C:\temp> Resolve-PowerBIError
HistoryId: 3
Message : Response status code does not indicate success: 403 (Forbidden).
StackTrace : at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.<InvokeRestMethod>d__31.MoveNext()
Exception : System.Net.Http.HttpRequestException
InvocationInfo : {Invoke-PowerBIRestMethod}
Line : Invoke-PowerBIRestMethod -Method POST -Url reports/4557598e-158d-407e-90e5-35a08b7c7584/ExportTo
Position : At line:1 char:1
+ Invoke-PowerBIRestMethod -Method POST -Url reports/4557598e-158d-407e ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 3
I have also tried this by creating a Service Principal, creating the application id, secret client key, adding the service principal to the workspace as Admin, here is the session from that, instead of 403 Forbidden I get back 401 Unauthorized. Note that I have also enabled Service Principal access to Power BI in the Tenant Settings Developer:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\WINDOWS\system32> cd \temp
PS C:\temp> Connect-PowerBIServiceAccount -ServicePrincipal -Credential (Get-Credential)
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
Environment : Public
TenantId :
ClientId :
Password : ********
PS C:\temp> Invoke-PowerBIRestMethod -Method POST -Url reports/4557598e-158d-407e-90e5-35a08b7c7584/ExportTo
WARNING: The Body parameter was null, the request may be invalid when Method parameter is Post.
Invoke-PowerBIRestMethod : One or more errors occurred.
At line:1 char:1
+ Invoke-PowerBIRestMethod -Method POST -Url reports/4557598e-158d-407e ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIR
estMethod], AggregateException
+ FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod
PS C:\temp> Resolve-PowerBIError
HistoryId: 3
Message : Response status code does not indicate success: 401 (Unauthorized).
StackTrace : at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod.<InvokeRestMethod>d__31.MoveNext()
Exception : System.Net.Http.HttpRequestException
InvocationInfo : {Invoke-PowerBIRestMethod}
Line : Invoke-PowerBIRestMethod -Method POST -Url reports/4557598e-158d-407e-90e5-35a08b7c7584/ExportTo
Position : At line:1 char:1
+ Invoke-PowerBIRestMethod -Method POST -Url reports/4557598e-158d-407e ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 3
Hi @Greg_Deckler ,
I came across a blog which was very helpful to resolve the issue. Provided the blog URL below.
http://dataap.org/blog/tag/export-to-pdf-rest-api/
Thanks,
Prakash
@Anonymous - The part that I am struggling with is getthing the authentication token. Am I missing it in the script where it explains how to do that or can you post your powershell code? I have found a number of blog articles on how to do it but they are all apparently out-of-date.
Hi @Greg_Deckler ,
Actually I haven't tried in Premium workspace yet. I need to get permission from client to implement it in Premium workspace, once i get the permission i will let you know.
I was trying it in my local and i was getting one or more error and the below URL was somewhat helped me.
http://dataap.org/blog/tag/export-to-pdf-rest-api/
Now i am getting one error and i think it will get resolve if i try it in Premium workspace. I think that API will work only in Premium Workspace so i am getting that one error.
I am unaware of authentication token part which you were facing. I am yet to face that scenario.
Thanks and Regards,
Prakash
@Anonymous Perhaps try it with PNG instead of PDF. Supposedly you do not need Premium for PNG but I still can't get it to work.
Hi @Greg_Deckler ,
DO we have any blog or documentation from microsoft on how to this with Power Automate and Power BI REST API.
Thanks in Advance
Via subscription you can send only one report page with email. Isnt there a possibilty to send an .png file which contains the whole report / all report pages?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
38 | |
26 | |
23 | |
19 | |
17 |
User | Count |
---|---|
49 | |
40 | |
24 | |
20 | |
20 |