# Export Report — Microsoft Power BI

> Export a Power BI report to a file format such as PDF, PPTX, or PNG. Requires a report ID (use List Reports to find it) and defaults to PDF if no format is given. Pass workspaceId (from List Workspaces) or workspaceName to target a…

- Key: `microsoft_power_bi-export-report`
- Type: Action (Write)
- Version: 0.0.3
- App: Microsoft Power BI (`microsoft_power_bi`) — https://pipedream.com/apps/microsoft-power-bi.md
- This page (HTML): https://pipedream.com/apps/microsoft-power-bi/actions/export-report
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/microsoft_power_bi/actions/export-report/export-report.mjs

## Description

Export a Power BI report to a file format such as PDF, PPTX, or PNG. Requires a report ID (use **List Reports** to find it) and defaults to PDF if no format is given. Pass `workspaceId` (from **List Workspaces**) or `workspaceName` to target a specific workspace, or omit both for My workspace. Supported `format` values depend on the report type: Power BI reports support `PDF`, `PPTX`, `PNG`. Paginated reports additionally support `CSV`, `XLSX`, `DOCX`, `XML`, `MHTML`. This API is **Premium-only**: requires the workspace to be backed by Premium capacity, Premium Per User, or Embedded capacity. On shared (free) capacity it returns `FixedCapacityLimitExceeded` / 403. The export is asynchronous — this tool starts the export, then polls until the job reaches `Succeeded` or `Failed` (or `pollTimeoutSeconds` elapses), then downloads the file and returns it as base64 along with the job metadata. PNG exports only work for single-page reports. For PPTX/PDF, pass `pages` (array of page names, e.g., `["ReportSection", "ReportSection1"]`) to limit the export. [See the documentation](https://learn.microsoft.com/en-us/rest/api/power-bi/reports/export-to-file-in-group)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `reportId` | `string` | Yes | ID of the report to export. Use List Reports to find IDs by name. |
| `format` | `string` | No | Output file format. Defaults to PDF. PDF/PPTX/PNG work for Power BI reports (PNG is single-page only). CSV/XLSX/DOCX/XML/MHTML are only supported for paginated reports. |
| `workspaceId` | `string` | No | ID of the workspace. Use the List Workspaces tool to see accessible workspaces. Omit to target My workspace. |
| `workspaceName` | `string` | No | Name of the workspace (alternative to Workspace ID). Use the List Workspaces tool to see accessible workspaces. |
| `pages` | `string[]` | No | Optional list of page names to include in the export. Page names are from the report's internal section IDs (e.g., ReportSection1), not visible page titles. If omitted, all pages are exported. |
| `pollIntervalSeconds` | `integer` | No | How often to poll the export job status. Minimum 1. |
| `pollTimeoutSeconds` | `integer` | No | Maximum time to wait for the export to complete before returning the in-progress job metadata. Default 300s. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "microsoft_power_bi",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "microsoft_power_bi-export-report",
  arguments: {
    reportId: "Report ID",
    format: "Format",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "microsoft_power_bi-export-report",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    microsoft_power_bi: { authProvisionId: "apn_xxxxxxx" },
    reportId: "Report ID",
    format: "Format",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "microsoft_power_bi-export-report",
    "configured_props": {
      "microsoft_power_bi": { "authProvisionId": "apn_xxxxxxx" },
      "reportId": "Report ID",
      "format": "Format"
    }
  }'
```

---

- App: https://pipedream.com/apps/microsoft-power-bi.md · All apps: https://pipedream.com/apps
