Exporting a Salesforce report to Excel has four valid approaches, and picking the wrong one wastes hours. Here is the decision matrix, then the exact steps for each method.
Quick decision matrix
| Your situation | Method |
|---|---|
| One-off export, < 100k rows | Lightning Export button (.xlsx, Details Only) |
| Need totals, group breaks, subtotals | Lightning Export → Formatted Report |
| Recurring (daily/weekly) report to your inbox | Report Subscribe with .xlsx attachment |
| > 100k rows or full historical data | Data Loader / Salesforce CLI export |
| Need both raw data and pivot tables | Export Details Only, then pivot in Excel |
Method 1: Lightning Export (the default 95% answer)
This is what most users want when they ask "how do I export a Salesforce report to Excel."
- Open the report (Reports tab → click the report name)
- Click the export icon (down-arrow) in the top-right of the report header. If you don't see it, your profile is missing the Export Reports permission, so ask an admin.
- Choose between two export views:
- Formatted Report keeps column groups, subtotals and grand totals. Best for sharing or printing.
- Details Only gives raw row data with a header row and no totals. Best for further analysis or pivot tables.
- Pick file format: .xlsx (Excel native) or .csv (universal, smaller).
- Click Export. Your browser downloads the file.
The .xlsx export caps at 100,000 rows. Hit the cap and Salesforce truncates silently, so check the row count after every export.
Method 2: Subscribe (recurring email)
For recurring reports (weekly sales pipeline, daily activity rollup) set up a subscription instead of running it manually.
- Open the report → click Subscribe in the action bar.
- Set frequency (daily / weekly / monthly) and time.
- Add recipients (yourself + others).
- Choose attach format: Formatted Report (.xlsx) or Details Only (.csv).
- Save. The first email arrives at the next scheduled interval.
Two caveats:
- Subscriptions respect each recipient's record visibility. If a colleague can't see a row, it's stripped from their copy.
- The 100,000-row export cap still applies.
Method 3: Data Loader / Salesforce CLI for huge exports
When the report exceeds 100k rows or you need to export the underlying object data outside the report definition, switch to Data Loader or Salesforce CLI:
# Salesforce CLI: export every Account modified in the last 90 days
sf data query \
--query "SELECT Id, Name, Industry, AnnualRevenue, LastModifiedDate FROM Account WHERE LastModifiedDate >= LAST_N_DAYS:90" \
--result-format csv \
--output-file accounts-90d.csv
This bypasses report builder limits, so only governor limits apply (20k rows for synchronous SOQL, more via Bulk API). You lose report features such as subtotals, grouping and formatted columns, and you gain unlimited row counts plus scriptability.
Method 4: Reports REST API (programmatic)
For custom integrations, such as embedding a Salesforce report in a Power BI dashboard or syncing to a data warehouse, use the Analytics REST API:
GET /services/data/vXX.0/analytics/reports/{reportId}
GET /services/data/vXX.0/analytics/reports/{reportId}?includeDetails=true
It returns JSON with report metadata, a fact map of raw rows, and aggregations. Power Automate, Zapier, n8n and custom Node scripts all use this endpoint, and it honours your report definition (filters, groups) without the row-count cap of the UI export.
Why is my export missing rows?
Three failure modes I see weekly:
- The 2,000-row preview is not the 100,000-row export. The report runs in the browser with a 2k preview cap, so don't copy from the on-screen table. Use the Export button.
- A hidden row limit in the report filter. Some reports have an explicit "Limit Rows" filter set to a small number. Open the Filters panel and check.
- Sharing and visibility. The user exporting may not have View All Data on every record the report owner can see. Re-run the report as the owner and compare the two row counts.
Why isn't the .xlsx file opening cleanly in Excel?
If Excel shows "The file format and extension don't match" or warns about "potentially unsafe content," the cause is usually that Salesforce sent a .csv with .xlsx extension via subscription. Workaround: rename to .csv and import via Data → From Text/CSV.
Common mistakes
- Confusing Formatted Report with Details Only. Formatted is human-readable, details is machine-friendly.
- Trying to export over 100k rows from the UI, which truncates silently.
- Forgetting that subscriptions filter by recipient sharing, so your colleagues' files won't match yours.
- Copy-pasting the on-screen preview instead of using Export, which gets you 2k rows at most.
For most users, the Lightning Export button + Details Only .xlsx is the right answer. Switch to subscriptions for recurring reports, and reach for Data Loader / CLI when the row count goes past six digits. See How to Share a Salesforce Report for the companion guide on getting the same data in front of a colleague without exporting at all.
Leave a Comment