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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
smpa01
Super User
Super User

Export to PDF

I am using ExportToFile API which is amazing to say the least.

How can I specify a page so that it only exports pgName=Pg10 instead of whole report. Also, I nedd to use a Filter .  I tried this in powershell which did not work as desired; it is still exporting the whole report. @AlonBAR  @GilbertQ@frithjof_v 

 

 

$reportID ="lorem-ipsum"
$apiEndpoint = "https://api.powerbi.com/v1.0/myorg/"

$requestUrl = $apiEndpoint+"reports"+"/"+$reportID+"/ExportTo"

#also I need to use a filter on pg10 where Calendar[Year] eq 2024
$requestBody = @"
{
	"format": "PDF",
    "pageName":"pg10"
  
}
"@

$response = Invoke-PowerBIRestMethod -Url $requestUrl -Method Post -Body $requestBody -ContentType "application/json" 

 

 

Thank you in advance.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 ACCEPTED SOLUTION

This is absolutely doable from the report with n number of pages. I have tested out.

 

Worflow => ExportToFile->Polling->Get File Of Export To File

 

$requestBody = @"
{
    "format": "PDF",
    "powerBIReportConfiguration": {
        "pages": [
            {
                "pageName": "ReportSection1234567890"
            }
        ],
        "reportLevelFilters": [
           {"filter": "Calendar/Month in ('Jan')"}
        ]
    }
}
"@@

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

2 REPLIES 2
GilbertQ
Super User
Super User

Hi @smpa01 

 

I'm not sure if this is possible to export a single page in a report. What I would do is just to create a new report with the single page, which you could then export.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

This is absolutely doable from the report with n number of pages. I have tested out.

 

Worflow => ExportToFile->Polling->Get File Of Export To File

 

$requestBody = @"
{
    "format": "PDF",
    "powerBIReportConfiguration": {
        "pages": [
            {
                "pageName": "ReportSection1234567890"
            }
        ],
        "reportLevelFilters": [
           {"filter": "Calendar/Month in ('Jan')"}
        ]
    }
}
"@@

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.