Skip to main content
SFDC Developers
Admin

How to Export a Salesforce Report to Excel: 4 Methods Compared

Vinay Vernekar · · 5 min read

Exporting a Salesforce report to Excel is one of those tasks that looks like a single workflow but actually has four valid approaches — and picking the wrong one wastes hours. Below is the decision matrix plus 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."

  1. Open the report (Reports tab → click the report name)
  2. 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 — ask an admin.
  3. Choose between two export views:
    • Formatted Report — keeps column groups, subtotals, grand totals; ideal for sharing or printing.
    • Details Only — raw row data with header row, no totals; ideal for further analysis or pivot tables.
  4. Pick file format: .xlsx (Excel native) or .csv (universal, smaller).
  5. Click Export. Your browser downloads the file.

The .xlsx export caps at 100,000 rows. Hit the cap and Salesforce truncates silently — always check row counts after export.

Method 2: Subscribe (recurring email)

For recurring reports — weekly sales pipeline, daily activity rollup — set up a subscription instead of running it manually.

  1. Open the report → click Subscribe in the action bar.
  2. Set frequency (daily / weekly / monthly) and time.
  3. Add recipients (yourself + others).
  4. Choose attach format: Formatted Report (.xlsx) or Details Only (.csv).
  5. 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 — only governor limits (20k rows for synchronous SOQL, more via Bulk API) apply. You lose report features (subtotals, grouping, formatted columns) and gain unlimited row counts plus scriptability.

Method 4: Reports REST API (programmatic)

For custom integrations — embedding a Salesforce report in a Power BI dashboard, 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

Returns JSON with report metadata, fact map (raw rows), and aggregations. Tools like Power Automate, Zapier, n8n, and custom Node scripts all use this endpoint. 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:

  • 2,000-row report preview vs 100,000-row export. The report runs in the browser with a 2k preview cap. Don't copy from the on-screen table — use the Export button.
  • 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 & visibility. The user exporting may not have View All Data on every record the report owner can see. Confirm with: re-run the report as the owner, compare row count.

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 — silently truncates.
  • Forgetting that subscriptions filter by recipient sharing — your colleagues' files won't match yours.
  • Copy-pasting the on-screen preview instead of using Export — you only get 2k rows that way.

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.

Share this article

Get weekly Salesforce dev tutorials in your inbox

Comments

Loading comments...

Leave a Comment

Trending Now