Forum Discussion
Save the Paginated Dynamic Subscription into the SharePoint or OneDrive
- 11 months ago
I ran into this same requirement and the easiest way I found to do it was to run a custom Python script to export the report.
Reports - Export To File - REST API (Power BI Power BI REST APIs) | Microsoft LearnHere is my function that does the export if it helps at all:
def export_report_pdf_with_filters(token: str, group_id: str, report_id: str, export_filter: str, outfile: pathlib.Path, include_hidden_pages: bool = False, poll_timeout_s: int = 300): headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"} body = { "format": "PDF", "powerBIReportConfiguration": { "reportLevelFilters": [{"filter": export_filter}], "settings": {"includeHiddenPages": include_hidden_pages} } } # 1) start start = requests.post(f"{PBI_API_BASE}/groups/{group_id}/reports/{report_id}/ExportTo", headers=headers, data=json.dumps(body)) start.raise_for_status() export_id = start.json()["id"] # 2) poll status_url = f"{PBI_API_BASE}/groups/{group_id}/reports/{report_id}/exports/{export_id}" t0 = time.time() while True: s = requests.get(status_url, headers=headers) s.raise_for_status() st = s.json().get("status") if st == "Succeeded": break if st == "Failed": raise RuntimeError(f"Export failed: {s.text}") retry_after = s.headers.get("Retry-After") time.sleep(int(retry_after) if retry_after and retry_after.isdigit() else 2) if time.time() - t0 > poll_timeout_s: raise TimeoutError(f"Polling timed out after {poll_timeout_s}s; last status={st}") # 3) download file_resp = requests.get(f"{status_url}/file", headers=headers) file_resp.raise_for_status() outfile.parent.mkdir(parents=True, exist_ok=True) outfile.write_bytes(file_resp.content) return outfileIf this helps, please consider giving Kudos. If I answered your question, mark this post as the solution.
Hi Suhel_Ansari Power BI Paginated Report subscriptions don’t natively save directly to SharePoint or OneDrive.
You can send the report via email and use Power Automate to pick up the attachment and store it in SharePoint/OneDrive. Other way is to use the Power BI Export API to programmatically export and upload reports.
Direct “Save to SharePoint/OneDrive” isn’t available out-of-the-box.
- Suhel_Ansari11 months agoHelper V
hi Akash_Varuna The standard Subscription do have the option to send the out of the paginated report to Sharepoint/OneDrive, I am more interested if we can do the same in the Dynamic Subscription as seen in the following screen print. thanks
Standard Subscription:
Dunamic Subscription: