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

Don'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.

Reply
Pikachu-Power
Impactful Individual
Impactful Individual

send report in pdf

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.

1 ACCEPTED SOLUTION

Subscribing to PBIX reports as PDF is currently not supported. It’s in our planned backlog. We will get to it in coming months but no specific timeline to share yet.

View solution in original post

17 REPLIES 17
v-easonf-msft
Community Support
Community Support

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) 

14.png

For more details ,you can refer to these articles.

https://docs.microsoft.com/en-us/power-bi/consumer/end-user-paginated-report#interact-with-a-paginat...

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.

Subscribing to PBIX reports as PDF is currently not supported. It’s in our planned backlog. We will get to it in coming months but no specific timeline to share yet.
Greg_Deckler
Super User
Super User

I don't believe so, you can export it as a PDF. Might be able to do it with Power Automate and Power BI REST API.


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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.



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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

 

 

 



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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.



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

I found the full source of the script but I get this error when trying to get the authentication token:

Method invocation failed because [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext] does not
contain a method named 'AcquireToken'.


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

And, I am still getting 403 forbidden when I skip the authentication piece for the app and just do it as myself. Now, I am not using a Premium workspace but I am also just trying to export as PNG which I should be allowed to do.


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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.



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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