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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
klinejordan
Advocate II
Advocate II

Export To File API specific pages

I am trying to build the Body of a HTTP call to export a non-paginated report to PDF. The simple body just specifying the format works without issue:

{
"format": "PDF"
}

 

But when I try to add references to specific pages, it works but still exports the entire report and not just the pages I specify. Am I missing something in the syntax?

 

{
"format": "PDF",
"powerBIReportExportConfiguration": {
"Pages": ["ReportSectiona9e3231081c009928308","ReportSectionff5f4406621243856c08"]
}
}

1 ACCEPTED SOLUTION

You take the output of Getpages and modify it as needed.

 

 

 

{
	format: "PDF",
        powerBIReportConfiguration:{"value": [
    {
      "Name": "ReportSection59a3330f95669ad473e6",
      "displayName": "1 Summary",
      "order": 0
    },
    {
      "Name": "ReportSectionc587b2defc60bdd51b80",
      "displayName": "2 Weekly FY20Q3",
      "order": 1
    }
   ]
  }
}       

 

 

 

EDIT: No, that didn't work it still exported the entire set of pages.  Here's the format that actually works

 

 

{
	format: "PDF",
        powerBIReportConfiguration:{pages:[{pageName:"ReportSection59a3330f95669ad473e6"},{pageName:"ReportSectionc587b2defc60bdd51b80"}]}
}   

 

 

So you were pretty close 🙂

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

Yes, the call expects a different format

 

Selecting which pages to print

Specify the pages you want to print according to the Get Pages or Get Pages in Group return value. You can also specify the order of the pages you're exporting.

Thanks @lbendlin but do you have an example of the syntax? I see that reference to Get Pages but not sure how to translate that to a JSON body in an HTTP call. Thanks!

You take the output of Getpages and modify it as needed.

 

 

 

{
	format: "PDF",
        powerBIReportConfiguration:{"value": [
    {
      "Name": "ReportSection59a3330f95669ad473e6",
      "displayName": "1 Summary",
      "order": 0
    },
    {
      "Name": "ReportSectionc587b2defc60bdd51b80",
      "displayName": "2 Weekly FY20Q3",
      "order": 1
    }
   ]
  }
}       

 

 

 

EDIT: No, that didn't work it still exported the entire set of pages.  Here's the format that actually works

 

 

{
	format: "PDF",
        powerBIReportConfiguration:{pages:[{pageName:"ReportSection59a3330f95669ad473e6"},{pageName:"ReportSectionc587b2defc60bdd51b80"}]}
}   

 

 

So you were pretty close 🙂

That worked! I was almost there! Thanks again!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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