Report represents a saved custom report definition: its data source, filters, columns, grouping, calculations, and presentation. It defines how to select and display data, not a stored set of results. This metadata type supports custom reports, not Salesforce standard reports. A custom report can still use a standard report type such as Opportunity.
Report and ReportType serve different purposes. A report selects and presents data using a report type; it does not define which objects and fields that report type makes available. Reports are also folder-scoped components, so their metadata identity includes the folder path rather than only the display name.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName, name, folderName
|
fullName identifies the folder-qualified component, such as MyReportFolder/MyReportName. Required name is the display name. folderName identifies the containing folder. |
reportType, reportTypeApiName
|
Required reportType determines the data being reported. reportTypeApiName specifies the report type's API name. |
scope, params
|
Report-type-specific selection settings. For Accounts reports, example scopes are MyAccounts, MyTeamsAccounts, and AllAccounts. Parameter names and values depend on the report type. |
filter |
criteriaItems defines field criteria; booleanFilter combines them logically. Each criterion's columnToColumn distinguishes field-to-field comparisons from comparisons against a value. |
timeFrameFilter |
Filters a required dateColumn using a required interval. INTERVAL_CUSTOM uses startDate and endDate. INTERVAL_CURRENT means the current fiscal quarter; INTERVAL_CURRENTQ means the current calendar quarter. |
crossFilters |
Tests for related records using operation values with or without. Join fields identify the parent and child sides. Each cross filter supports up to five criteriaItems subfilters. |
aggregateFilters |
Filters custom summary formula results in summary, matrix, and joined reports. Each entry specifies an aggregate, operator, and value. |
format, block, blockInfo
|
Formats include Tabular, Summary, Matrix, and the joined-report serialization MultiBlock. Joined reports contain recursive block definitions. The documented Joined enumeration conflicts with the joined-report XML example. |
columns, rowLimit, showDetails
|
Columns appear in definition order. rowLimit caps returned rows. showDetails=false collapses the display to headings, subtotals, and totals; it does not add a record filter. showDetails defaults to true. |
groupingsDown, groupingsAcross, sortColumn, sortOrder
|
Defines grouping and sorting. Summary reports support up to three downward groupings; matrix reports support up to two in each direction. Detail sorting uses sortColumn and sortOrder, with values Asc or Desc. |
aggregates |
Defines custom summary formulas. developerName is the internal reference identifier. Required datatype values are currency, number, and percent. isActive controls formula-result display. |
buckets |
Creates report-local categories from sourceColumnName. bucketType values are text, number, and picklist. developerName must follow BucketField_name. |
historicalSelector, showCurrentDate
|
Selects historical comparison dates. snapshot accepts relative values such as N_DAYS_AGO:2 or absolute dates in yyyy-MM-dd format. showCurrentDate applies to historical-trending matrix reports. |
chart |
Defines chart summaries, grouping, type, and axes. Invalid chartSummaries entries are silently ignored; if none remain valid, Salesforce uses RowCount for the axis value. |
colorRanges, formattingRules
|
Conditional highlighting for Salesforce Classic and Lightning Experience, respectively. Lightning supports up to five formatting rules per report. |
Behavior and Constraints
Data selection and user context
Interpret the selection settings together. filter.criteriaItems filters detail records, timeFrameFilter limits a date field, and crossFilters tests whether related records exist. aggregateFilters operates on custom summary formula results instead of detail-record values.
scope and params do not have one universal set of values. For example, Activities report parameters can select tasks, events, or both, and open activities, closed activities, or both. A scope or parameter copied from another report type is not necessarily applicable.
For cross filters, primaryTableColumn identifies the parent-side field, relatedTable identifies the child object, and relatedTableJoinColumn identifies the child-side join field. The optional subfilters further restrict the related records being tested.
roleHierarchyFilter, territoryHierarchyFilter, and userFilter specify hierarchy drilldowns using a role name, territory name, and username, respectively. If the org uses divisions and the Affected by Divisions permission is enabled, reported records must match division.
A criterion with isUnlocked=true can be edited on the Lightning report run page. The default is false. This setting controls filter editability, not the user's access to records. Likewise, numSubscriptions is user-context-dependent: 1 means the user is subscribed and 0 means the user is not subscribed. It is not an org-wide subscriber count.
Filter values can differ from their report-builder display. Dates in ReportFilterItem.value are converted to US date format, and values entered in another language can be normalized to a US English equivalent. filter.language matters when a picklist filter uses contains or startsWith.
Grouping and joined reports
Summary reports support up to three groupingsDown fields. Matrix reports support up to two groupingsDown and two groupingsAcross fields. Column order controls display order; it does not define an execution sequence.
Group sorting is separate from detail sorting. A grouping's sortType selects Column, Aggregate, or CustomSummaryFormula. Its sortByName identifies the sort target, and aggregateType identifies the aggregate calculation when applicable. Report-level sortColumn and sortOrder control detail-data sorting.
A joined report contains block entries, each of which can use a different reportType and carry its own report settings. These are internal report structures, not separately deployed reports. Their internal references must remain consistent:
-
blockInfo.blockIdis assigned automatically, with valuesB1throughB5. Formulas and chart summaries use it to identify the source block. -
blockInfo.joinTableidentifies the entity that supplies fields for global grouping across blocks. -
blockInfo.aggregateReferences.aggregaterefers to anaggregates.developerName. - Cross-block expressions use block-qualified tokens such as
B1#AMOUNT:SUM. A joined-report chart can similarly useB1#RowCount.
A joined report does not inherently show only rows common to its blocks. showCommonRowsOnly explicitly controls that display and defaults to false.
Formulas and bucket fields
aggregates defines custom summary formulas. Each formula's calculatedFormula contains the expression, while acrossGroupingContext and downGroupingContext determine where the result appears. Its developerName is an internal identifier referenced by other report components, including conditional highlighting; it is not merely a label.
aggregates.isActive controls whether the formula result is displayed. It does not activate or deactivate the report. isCrossBlock distinguishes joined-report cross-block formulas from standard summary formulas. For joined-report formulas, the aggregate's reportType identifies the block report types to which it can be added.
Row-level formulas are a separate calculation structure, not additional ReportAggregate entries. Their documented data types are Double, DateOnly, DateTime, and Text, rather than the summary-formula values currency, number, and percent. The row-level element names also differ between representations, as described under Documentation Inconsistencies.
Bucket fields create categories local to the report. Their developerName, in the form BucketField_name, is reused in columns, filters, sorting, grouping, and charts. Numeric buckets have specific boundary rules:
-
fromis exclusive, andtois inclusive. - The first numeric bucket has only
to; the last has onlyfrom; intermediate buckets have both. -
nullTreatment=ztreats empty values as zero;nullTreatment=ndoes not.
Historical comparisons, fiscal settings, and currency
Historical trending uses historicalSelector and criterion-level snapshot values to select comparison dates. A snapshot can be relative, such as N_DAYS_AGO:2, or absolute, in yyyy-MM-dd format. columns.showChanges adds differences between current and historical Date and Amount values. These settings are distinct from an AnalyticSnapshot component that uses the report as its source.
FiscalPeriod and FiscalWeek grouping, along with custom fiscal-period and fiscal-week intervals, depend on custom fiscal years being enabled. Calendar and fiscal intervals are distinct even when their names look similar.
In applicable multicurrency reports, currency controls the currency used to display converted amounts. It does not declare that all source records use that currency.
Charts and conditional highlighting
A chart can display record counts instead of the intended measure without reporting a chart-summary error. Salesforce ignores invalid chart.chartSummaries entries without notification. If no valid summaries remain, it uses RowCount for the axis value.
Chart summaries can reference fields, custom summary formulas, or RowCount. The summary's aggregate is unnecessary for RowCount and custom summary formulas. Available chart types depend on the report type. To specify an axis range manually, use summaryAxisRange=Manual with summaryAxisManualRangeStart and summaryAxisManualRangeEnd.
colorRanges provides Salesforce Classic conditional highlighting; formattingRules provides Lightning Experience highlighting. Lightning supports up to five rules per report. Within a Lightning rule, an omitted rangeUpperBound means positive infinity, and a range without a color is transparent.
Deployment and Retrieval
Metadata API report files are stored in the package's reports directory with the .report extension. The deployment and retrieval identity is the folder-qualified fullName, such as MyReportFolder/MyReportName. Do not substitute the report's display name or its runtime report record ID.
Report does not support wildcard members in package.xml, the deployment and retrieval manifest. Enumerate explicit component names instead:
- Call
listMetadatawithtypeset toReportFolderandfolderset to*. - Use the returned folder
fullNamevalues to calllistMetadataforReportcomponents within each folder. - Use the returned folder-qualified report
fullNamevalues as explicitReportmembers inpackage.xml.
describeMetadata returns Report with inFolder=true, but it does not return ReportFolder as a separate type.
Specify folder retrieval and deployment members under Report. A nested folder referenced without its contents needs a trailing slash, such as TopLevel/SubLevel/. A report within that folder uses a member such as TopLevel/SubLevel/MyReport.
Without the trailing slash, TopLevel/SubLevel is interpreted as a report named SubLevel. The documented failure is: Entity of type 'Report' named 'TopLevel/SubLevel' cannot be found.
Dependency review must extend beyond displayed columns. Filters, grouping, date selection, buckets, charts, sorting, and formula expressions can all introduce dependencies. Some tokens identify report-local buckets or formulas rather than fields. Actual references determine the relevant deployment scope; the possible connections do not require deploying every associated metadata type.
Relationships
A report connects its report type to selected fields, filters, calculations, and presentation. Incoming references can extend that impact to dashboards, reporting snapshots, layouts, and Lightning pages. For example, a dashboard reference can lead through a report to its report type and field dependencies.
Folder identity is a separate path-based association with ReportFolder, expressed through the containing folder and the folder-qualified component name. It is not a field dependency. Formula expressions in calculatedFormula also require expression-level interpretation because they can embed field references and block-summary references.
References
-
CustomField:column,columnName,dateColumn,field,groupingColumn,primaryTableColumn,relatedTableJoinColumn,secondaryGroupingColumn,sortByName,sortColumn,sourceColumnName. -
CustomObject:field,joinTable,relatedTable,reportType. -
DataCategoryGroup:dataCategoryGroup. -
ReportType:reportType,reportTypeApiName. -
Role:roleHierarchyFilter. -
Territory:territoryHierarchyFilter. -
TerritoryModel:territoryHierarchyFilter.
Referenced By
-
AnalyticSnapshot:sourceReport. -
Dashboard:report. -
FlexiPage:value. -
Layout:reportName. -
Translations:name.
Documentation Inconsistencies
The Salesforce ReportFormat enumeration lists Joined, while its joined-report XML example uses MultiBlock. The exposed format values also include MultiBlock. This discrepancy matters when validating serialized enumeration values; do not assume the documented format label and the XML value are identical.
Row-level formula naming also differs between representations. Salesforce documents reportCustomDetailFormula with datatype values Double, DateOnly, DateTime, and Text. An alternate exposed structure uses customDetailFormulas with dataType represented as a string. Neither structure is an additional ReportAggregate entry, and summary-formula data types should not be substituted for row-level formula data types.
Reported Issues
-
Missing objects or fields can require changes outside the report definition. Community troubleshooting identifies the object's Allow Reports setting and the custom report type's Fields Available for Reports layout as checks. A November 2024 report additionally found that a master-detail child's master needed reporting enabled in that scenario. These are diagnostic leads, not proof that changing
Report.columnswill expose the field. See the missing custom object discussion. - Retrieving a definition does not establish that an integration user can execute the report or see its intended records. A March 2020 community explanation identifies API Enabled, Run Reports, and the executing user's data visibility as relevant prerequisites. API execution therefore needs a separate access assessment from metadata retrieval. See the report API access discussion.
-
An apparently correct metadata field token may still return a disputed runtime value. In September 2022, a community report found that
Opportunity.OpportunityContactRoles$LastModifiedDatereturned a Contact-level timestamp. The author reported success using a formula field onOpportunityContactRolethat returned its ownLastModifiedDate. Compare the actual returned values in this scenario; the report does not establish that such formulas are generally necessary. See the Opportunity Contact Role timestamp discussion.
Common Questions
Can I retrieve all reports with a wildcard in package.xml?
No. Report requires explicit members. First list report folders with listMetadata, then list reports within each folder, and use the returned folder-qualified fullName values.
Why does Salesforce say a nested report folder cannot be found?
A folder-only member such as TopLevel/SubLevel is interpreted as a report named SubLevel. Use TopLevel/SubLevel/, including the trailing slash, to identify the nested folder.
Does Report metadata include standard reports or define a custom report type?
It supports custom reports, not Salesforce standard reports. A custom report can use a standard report type. The report selects and presents data; ReportType defines the available objects and fields.
Why is my report chart showing record counts instead of amounts?
Invalid chart.chartSummaries entries are ignored without notification. If none remain valid, Salesforce uses RowCount for the axis value. Check the summary field or formula identifiers and, for joined reports, their block-qualified references.
Does showDetails=false filter records out of a report?
No. It collapses the display to headings, subtotals, and totals. Record selection comes from the report's selection settings, while rowLimit caps the number of returned rows.