Forum Discussion
smpa01
2 years agoCommunity Champion
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 GilbertQfrithjof_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.
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')"} ] } } "@@
2 Replies
- smpa01Community Champion
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')"} ] } } "@@