No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
Report
Represents a custom report. This type extends the Metadata metadata type and inherits its fullName field. This metadata type only supports custom reports; standard reports are not supported.
Declarative Metadata File Suffix and Directory Location
Reports are stored in the reports directory of the corresponding package directory. The file name matches the report title and the extension is .report.
Retrieving Reports
You can’t use the wildcard (*) symbol with reports in package.xml. To retrieve the list of reports for populating package.xml with explicit names, call listMetadata() and pass in ReportFolder as the type. Note that ReportFolder is not returned as a type in describeMetadata(). Report is returned from describeMetadata() with an associated attribute of inFolder set to true. If that attribute is set to true, you can construct the type by using the component name with the word Folder, such as ReportFolder.
The following example shows folders in package.xml:
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>MyDBFolder/MyDBName</members>
5 <name>Dashboard</name>
6 </types>
7 <types>
8 <members>MyDocumentFolder/MyDocumentName</members>
9 <name>Document</name>
10 </types>
11 <types>
12 <members>unfiled$public/MarketingProductInquiryResponse</members>
13 <members>unfiled$public/SalesNewCustomerEmail</members>
14 <name>EmailTemplate</name>
15 </types>
16 <types>
17 <members>MyReportFolder/MyReportName</members>
18 <name>Report</name>
19 </types>
20 <version>33.0</version>
21</Package>Version
Report components are available in API version 14.0 and later.
Fields
The following information assumes that you are familiar with creating and running reports. For more information on these fields, see “Create a Report” in the Salesforce online help.
| Field | Field Type | Description |
|---|---|---|
| aggregates | ReportAggregate[] | List that defines custom summary formulas for summary, matrix, and joined reports. |
| block | Report[] | Represents each block in a joined report where every block can be of a different report type. |
| blockInfo | ReportBlockInfo | Defines attributes for each block in a joined report. |
| buckets | ReportBucketField[] | Defines a bucket field to be used in the report. This field is available in API version 24.0 and later. |
| chart | ReportChart | Defines a chart for summary and matrix reports . |
| colorRanges | ReportColorRange[] | List that specifies conditional highlighting for report summary data. |
| columns | ReportColumn[] | List that specifies the fields displayed in the report. Fields appear in the report in the same order as they appear in the Metadata API file. |
| crossFilters | ReportCrossFilter[] | Defines a cross filter's object, related object, and condition (WITH or WITHOUT). This field is available in API version 33.0 and later. |
| currency | CurrencyIsoCode (enumeration of type string) | When using multiple currencies, some reports allow you to display converted amounts by selecting the appropriate column to display. For example, in opportunity reports, you can include the Amount (converted) column on the report. This field is an enumeration of type string that defines the currency in which to display converted amounts. Valid values: Must be one of the valid alphabetic, three-letter currency ISO codes defined by the ISO 4217 standard, such as USD, GBP, or JPY. |
| description | string | Specifies a general description, which is displayed with the report name. Maximum characters: 255 characters. |
| division | string | If your organization uses divisions
to segment data and you have the “Affected by Divisions”
permission, records in the report must match this division. This field is available in API version 17.0 and later. |
| filter | ReportFilter | Limits report results to records with specific data. For example,
you can limit report results to opportunities for which the amount
is greater than $1,000:For more information, see “Enter Filter Criteria” in the Salesforce online help. |
| format | ReportFormat (enumeration of type string) | Defines the report format. For example, Tabular for a simple data list without subtotals. |
| fullName | string | The report unique developer name used as an identifier for API access. The fullName can contain only underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. This field is inherited from the Metadata component. |
| groupingsAcross | ReportGrouping[] | List that defines the fields by which you want to group and subtotal data across a matrix report (row headings). When grouping by a date field, you can further group the data by a specific time period such as days, weeks, or months. Maximum: 2 fields. |
| groupingsDown | ReportGrouping[] | For Summary and Matrix reports: List that defines the fields by which you want to group and subtotal. For summary reports, choosing more than one sort field allows you to subsort your data. For matrix reports, specifies summary fields for column headings. When grouping by a date field, you can further group the data by a specific time period such as days, weeks, or months. Maximum for matrix reports: 2. Maximum for summary reports: 3 |
| historicalSelector | ReportHistoricalSelector | Defines a date range for which
historical trend reporting data is to be captured. Default is “Any
Historical Date.” Available in API version 29 and later. |
| name | string | Required. The report name. For example, Opportunity Pipeline |
| params | ReportParam[] | List that specifies settings specific to each report type, in particular options that let you filter a report to obtain useful subsets. For example, the Activities report type lets you specify whether you want to see open or closed activities or both and whether you want to see tasks or events or both. Valid values depend on the report type. |
| reportType | string | Required. Defines the type of data in the report. For example, Opportunity to create a report of opportunities data. |
| roleHierarchyFilter | string | The role name for a
report drill down. Some reports, such as opportunity and activity
reports, display Hierarchy links that allow you to drill down to different
data sets based on the role hierarchy. This field is available in API version 17.0 and later. |
| rowLimit | int | Defines the maximum number of rows that can be returned for the report. |
| scope | string | Defines the scope of data on which you run the report. For
example, whether you want to run the report against all opportunities,
opportunities you own, or opportunities your team owns. Valid values
depend on the reportType. For example, for Accounts reports:
|
| showCurrentDate | boolean | Can be set to true for historical trending reports in
matrix format. Available in API version 29 and later. |
| showDetails | boolean | false shows a collapsed view of the report with only the headings, subtotals, and total. Default: true |
| sortColumn | string | Specifies the field on which to sort data in the report. Use sortOrder to specify the sort order. |
| sortOrder | SortOrder (enumeration of type string) | Specifies the sort order. Use sortColumn to specify the field on which to sort. |
| territoryHierarchyFilter | string | The territory
name for a report drill down. If your organization uses territory
management, some reports display Hierarchy links that allow you to
drill down to different data sets based on the territory hierarchy. This field is available in API version 17.0 and later. |
| timeFrameFilter | ReportTimeFrameFilter | Limits report results to records within a specified time frame. |
| userFilter | string | The user name for a report drill
down. Some reports, such as opportunity and activity reports, display
Hierarchy links that allow you to drill down to different data sets
based on the user hierarchy. This field is available in API version 17.0 and later. |
ReportAggregate
ReportAggregate defines custom summary formulas on summary, matrix, and joined reports. For more information on these fields, see “Build a Custom Summary Formula” in the Salesforce online help.
| Field | Field Type | Description |
|---|---|---|
| acrossGroupingContext | string | Defines the row grouping level at which you want your custom summary formula to be displayed. This is a new field in API version 15.0. |
| calculatedFormula | string | Required. The custom summary formula. For example, AMOUNT:SUM + OPP_QUANTITY:SUM |
| datatype | ReportAggregateDatatype (enumeration of type string) | Required. Specifies the data type for formatting and display of the custom summary formula results. |
| description | string | The custom summary formula description. Maximum: 255 characters. |
| developerName | string | Required. The internal development name of the custom summary formula, for example, FORMULA1. This is used to reference custom summary formulas from other report components, including conditional highlighting. |
| downGroupingContext | string | Defines the column grouping level at which you want your custom summary formula to be displayed. This field is available in API version 15.0 and later. |
| isActive | booleanblo | Required. true displays the formula result in the report. false does not display the result in the report. |
| isCrossBlock | boolean | Determines whether the custom summary
formula is a cross-block formula, which is available with joined reports. true indicates a cross-block custom summary
formula. false indicates a standard
custom summary formula. This field is available in API version 25.0 and later. |
| masterLabel | string | Required. The custom summary formula label (name). |
| reportType | string | Required for joined reports. Specifies the reportType of the blocks to which the aggregate can be added. |
| scale | int | The formula result is calculated to the specified number of decimal places. Valid values 0 through 18. |
ReportBlockInfo
ReportBlockInfo defines blocks in a joined report.
| Field | Field Type | Description |
|---|---|---|
| aggregateReferences | ReportAggregateReference[] | Lists the aggregates that represent the custom summary formulas used in a joined report block. |
| blockId | string | Required. blockId is
used in cross-block custom summary formulas and joined report charts
to identify the block containing each summary field. blockId is assigned automatically. Valid values are B1 through B5. This field is available in API version 25.0 and later. |
| joinTable | string | Required. Refers to the entity used to join blocks in a joined report. The entity provides a list of fields that are available for globally grouping across the blocks. |
ReportAggregateReference
ReportAggregateReference defines the developer name used for custom summary formulas in joined reports.
ReportBucketField
ReportBucketField defines a bucket to be used in the report.
| Field | Field Type | Description |
|---|---|---|
| bucketType | ReportBucketFieldType (enumeration of type string) | Required. Specifies the type of bucket. Valid values:
|
| developerName | string | Required. A unique name used as the <field> value to display a bucket field in the column list and other report components, including sort, filter, list, group, and chart. Must be of the format BucketField_name. For example, BucketField_BusinessSize. |
| masterLabel | string | Required. The bucket field label. Maximum 40 characters. Any line breaks, tabs, or multiple spaces at the beginning or end of the label are removed. Any of these characters within the label are reduced to a single space. |
| nullTreatment | ReportBucketFieldNullTreatment (enumeration of type string) | For numeric bucket fields only. Specifies whether empty values are treated as zeros (z) or not (n). |
| otherBucketLabel | string | The label of the container for unbucketed values. |
| sourceColumnName | string | Required. The source field that the bucket is applied to. For example, SALES or INDUSTRY. |
| values | ReportBucketFieldValue (enumeration of type string) | Defines one bucket value used in the bucket field. |
ReportBucketFieldValue
ReportBucketFieldValue defines a bucket value used in the bucket field.
| Field | Field Type | Description |
|---|---|---|
| sourceValues | ReportBucketFieldSourceValue (enumeration of type string) | The value of a bucket in the bucket field. Valid values:
In numeric buckets, the first value must only have to and last value must only have from. All other values must have both to and from. |
| value | string | Required. The name of a specific bucket value within the bucket field. |
ReportGrouping
ReportGrouping defines how to group, subtotal, and sort data for summary, matrix, and joined reports.
| Field | Field Type | Description |
|---|---|---|
| aggregateType | ReportAggrType (enumeration of type string) | The type of aggregate value to sort
by. Valid values are:
|
| dateGranularity | UserDateGranularity (enumeration of type string) | When grouping by a date field, the time period by which to group. |
| field | string | Required. The field by which you want to summarize data. For example, CAMPAIGN_SOURCE |
| sortByName | string | The API name of the column, aggregate or custom summary field used to order the grouping. |
| sortOrder | SortOrder | Required. Whether to sort data in ascending or descending alphabetical and numerical order. |
| sortType | ReportSortType (enumeration of type string) | Indicates if the grouping is sorted by
a column, aggregate or custom summary field. Valid values are:
|
ReportHistoricalSelector
ReportHistoricalSelector defines a date range for historical data.
| Field | Field Type | Description |
|---|---|---|
| snapshot | string | Represents the date value to apply a historical filter, either
relative (in the format N_DAYS_AGO:2) or absolute (in the format yyyy-MM-dd). If unspecified, it’s assumed that the filter will be applied
to all the columns the user sees. Available in API version 29 and later. |
SortOrder
An enumeration of type string that defines the order in which data is sorted in the report fields. Valid values:
| Field | Description |
|---|---|
| Asc | Sorts data in ascending alphabetical and numerical order. |
| Desc | Sorts data in descending alphabetical and numerical order. |
UserDateGranularity
An enumeration of type string that defines the time period by which to group data. Valid values:
| Enumeration Value | Description |
|---|---|
| None | No grouping by date |
| Day | By day |
| Week | By week |
| Month | By month |
| Quarter | By quarter |
| Year | By year |
| FiscalQuarter | By fiscal quarter. You can set the fiscal year for your organization. See “Setting the Fiscal Year” in the Salesforce online help. |
| FiscalYear | By fiscal year |
| MonthInYear | By calendar month in year |
| DayInMonth | By calendar day in month |
| FiscalPeriod | When custom fiscal years are enabled: By fiscal period |
| FiscalWeek | When custom fiscal years are enabled: By fiscal week |
ReportSummaryType
An enumeration of type string that defines how report fields are summarized. Valid values:
| Enumeration Value | Description |
|---|---|
| Sum | Total |
| Average | Average |
| Maximum | Largest value |
| Minimum | Smallest value |
| None | The field is not summarized. |
ReportColorRange
ReportColorRange defines conditional highlighting for report summary data.
| Field | Field Type | Description |
|---|---|---|
| aggregate | ReportSummaryType (enumeration of type string) | Required. Defines how the field specified in columnName is summarized. For example, Sum. |
| columnName | string | Required. Specifies the field whose value ranges are represented by colors. |
| highBreakpoint | double | Required. Specifies the number that separates the mid color from the high color. |
| highColor | string | Required. Specifies the color (in HTML format) to represent data that falls into the high number range. This color spans from the highBreakpoint value. |
| lowBreakpoint | double | Required. Specifies the number that separates the low color from the mid color. |
| lowColor | string | Required. Specifies a color (in HTML format) to represent data that falls into the low value range, below the lowBreakpoint value. |
| midColor | string | Required. Specifies a color (in HTML format) to represent data that falls into the mid value range. |
ReportColumn
ReportColumn defines how fields (columns) are displayed in the report.
| Field | Field Type | Description |
|---|---|---|
| aggregateTypes | ReportSummaryType[] (enumeration of type string) | List that defines if and how each report field is summarized. |
| field | string | Required. The field name. For example, AGE or OPPORTUNITY_NAME |
| reverseColors | boolean | In historical trend reports, displays
greater Date values as green and greater Amount values as red, reversing
the default colors. Available in API version 29.0 and later. |
| showChanges | boolean | In historical trend reports, adds
a column displaying the difference between current and historical
Date and Amount values. Available in API version 29.0 and later. |
ReportFilter
ReportFilter limits the report results by filtering data on specified fields.
| Field | Field Type | Description |
|---|---|---|
| booleanFilter | string | Specifies filter logic conditions. For more information on filter logic, see “Getting the Most Out of Filter Logic” in the Salesforce online help. |
| criteriaItems | ReportFilterItem | The criteria by which you want to filter report data, either
by comparing historical values or by applying a date range. |
| language | Language (enumeration of type string) | The language used when a report filters against a picklist value using the operators contains or startsWith. For a list of valid language values, see Language. |
ReportFilterItem
ReportFilterItem limits the report results by filtering data on specified fields.
| Field | Field Type | Description |
|---|---|---|
| column | string | Required. The field on which you want to filter data. For example, AMOUNT |
| columnToColumn | boolean | Indicates that the field contains data from a historical snapshot. Available in API version 29 and later. |
| operator | FilterOperation (enumeration of type string) | Required. An enumeration of type string that defines the operator used to filter the data, for example, greaterThan. For valid values, see FilterOperation. |
| snapshot | string | Represents the date value, either relative (in the format N_DAYS_AGO:2) or absolute (in the format yyyy-MM-dd). Available in API version 29 and later. |
| value | string | The value by which you want to filter the data, for example, 1000. Note that the Metadata API filter condition values do not always match those that you enter in the report wizard. For example, in the Metadata API dates are always converted to the US date format and values entered in a non-US English language may be converted to a standard US English equivalent. |
ReportFormat
An enumeration of type string that defines the report format. Valid values:
| Enumeration Value | Description |
|---|---|
| Matrix | Summarizes data in a grid. Use to compare related totals. |
| Summary | Lists, sorts, and subtotals data. |
| Tabular | Lists data with no sorting or subtotals. |
| Joined | Joins data from different report types storing each report’s data in its own block. |
ReportParam
ReportParam represents settings specific to a report type, especially options that let you filter a report to certain useful subsets.
| Field | Field Type | Description |
|---|---|---|
| name | string | Required. Specifies a specific reportType setting. |
| value | string | Required. The setting value. |
ReportAggregateDatatype
An enumeration of type string that specifies the data type for formatting and display of custom summary formula results. Valid values:
| Enumeration Value |
|---|
| currency |
| number |
| percent |
ReportChart
ReportChart represents charts on summary, matrix, and joined reports.
| Field | Field Type | Description |
|---|---|---|
| backgroundColor1 | string | Specifies the beginning color (in HTML format) for a gradient color background. |
| backgroundColor2 | string | Specifies the end color (in HTML format) for a gradient color background. |
| backgroundFadeDir | ChartBackgroundDirection (enumeration of type string) | Specifies the direction for a gradient color background. Use
with backgroundColor1 to specify the beginning color and backgroundColor2 to specify the end color for the gradient design. Use white for
both if you do not want a background design. Valid values:
|
| chartSummaries | ChartSummary[] | Specifies the summaries you want to use for the chart. Invalid summaries are ignored without notification. If there are no valid summaries, RowCount is used by default for the axis value. This field is available in API version 17.0 and later. |
| chartType | ChartType (enumeration of type string) | Required. Specifies the chart type. Available chart types depend on the report type. |
| enableHoverLabels | boolean | Specifies whether to display values, labels, and percentages when hovering over charts. Hover details depend on chart type. Percentages apply to pie, donut, and funnel charts only. This field is available in API version 17.0 and later. |
| expandOthers | boolean | Specifies whether to combine all groups less than or equal to 3% of the total into a single 'Others' wedge or segment. This only applies to pie, donut, and funnel charts. Set to true to show all values individually on the chart; set to false to combine small groups into 'Others.' This field is available in API version 17.0 and later. |
| groupingColumn | string | Specifies the field by which to group data. This data is displayed on the X-axis for vertical column charts and on the Y-axis for horizontal bar charts. |
| legendPosition | ChartLegendPosition (enumeration of type string) | Required. The location of the
legend with respect to the chart. The valid values are:
|
| location | ChartPosition (enumeration of type string) | Required. Specifies whether the chart is displayed at the top or bottom of the report. |
| secondaryGroupingColumn | string | For grouped chart types: Specifies the field by which to group the data. |
| showAxisLabels | boolean | For bar and line charts: Specifies whether the chart displays names for each axis. |
| showPercentage | boolean | Indicates if percentages are displayed for wedges and segments of pie, donut, and funnel charts, as well as for gauges (true), or not (false). |
| showTotal | boolean | Indicates if the total is displayed for donut charts and gauges (true), or not (false). |
| showValues | boolean | Indicates if the values of individual records or groups are displayed for charts (true), or not (false). |
| size | ReportChartSize (enumeration of type string) | Required. Specifies the chart size. |
| summaryAggregate | ReportSummaryType (enumeration of type string) | Defines how to summarize the chart data. For example, Sum. No longer supported in version API 17.0 and later. See chartSummaries. |
| summaryAxisManualRangeEnd | double | When specifying the axis range manually: Defines the ending value. |
| summaryAxisManualRangeStart | double | When specifying the axis range manually: Defines the starting value. |
| summaryAxisRange | ChartRangeType (enumeration of type string) | Required. For bar, line, and column charts: Defines whether to specify the axis range manually or automatically. |
| summaryColumn | string | Required. Specifies the field by which to summarize the chart data. Typically this field is displayed on the Y-axis. No longer supported in version API 17.0 and later. See chartSummaries. |
| textColor | string | The color (in HTML format) of the chart text and labels. |
| textSize | int | The size of the chart text and labels. Valid values:
The maximum size is 18. Larger values are shown at 18 points. |
| title | string | The chart title. Max 255 characters. |
| titleColor | string | The color (in HTML format) of the title text. |
| titleSize | int | The size of the title text. Valid values:
The maximum size is 18. Larger values are shown at 18 points. |
ChartType
An enumeration of type string that defines the chart type. For information on each of these chart types, see “Chart Types” in the Salesforce online help. Valid values:
ChartPosition
An enumeration of type string that specifies the position of the chart in the report. Valid values:
| Enumeration Value |
|---|
| CHART_TOP |
| CHART_BOTTOM |
ChartSummary
ChartSummary defines how data in the chart is summarized. Valid values:
| Field | Field Type | Description |
|---|---|---|
| aggregate | ReportSummaryType | Specifies the aggregation method—such as Sum, Average, Min, and Max—for the summary value. Use the column field to specify the summary value to use for the aggregation. You don't need to specify this field for RowCount or custom summary formulas. |
| axisBinding | ChartAxis | Specifies the axis or axes to use on the chart. Use the column field to specify the summary value to use for the axis. |
| column | string | Required. Specifies the summary field for the chart data. If all columns are invalid, RowCount is used by default for the axis value. For vertical column and horizontal bar combination charts, you can specify up to four values. |
ChartAxis
An enumeration of type string that specifies the axis or axes to be used in charts. Valid values:
ReportChartSize
An enumeration of type string that specifies the chart size. Valid values:
| Enumeration Value |
|---|
| Tiny |
| Small |
| Medium |
| Large |
| Huge |
ChartRangeType
An enumeration of type string that defines the report format. Valid values:
| Enumeration Value |
|---|
| Auto |
| Manual |
ReportTimeFrameFilter
ReportTimeFrameFilter represents the report time period.
| Field | Field Type | Description |
|---|---|---|
| dateColumn | string | Required. The date field on which to filter data. For example, CLOSE_DATE |
| endDate | date | When interval is INTERVAL_CUSTOM, specifies the end of the custom time period. |
| interval | UserDateInterval (enumeration of type string) | Required. Specifies the period of time. |
| startDate | date | When interval is INTERVAL_CUSTOM, specifies the start of the custom time period. |
ReportCrossFilter
ReportCrossFilter represents the cross filter functionality in reports.
| Field | Field Type | Description |
|---|---|---|
| criteriaItems | ReportFilterItem | Represents the subfilters of a cross filter. There can be up
to five subfilters. This field requires the following attributes.
|
| operation | ObjectFilterOperator. Enumeration of type string | The action indicating whether to include or exclude an object. Valid values: with and without. |
| primaryTableColumn | string | The parent object used for the cross filter. |
| relatedTable | string | The child object used for the cross filter. |
| relatedTableJoinColumn | string | The field from the child object that is used to join the parent. |
Declarative Metadata Sample Definition
A sample XML snippet using cross filters to build an Accounts report for cases where case status is not closed:
1<crossFilters>
2 <criteriaItems>
3 <column>Status</column>
4 <operator>notequal</operator>
5 <value>Closed</value>
6 </criteriaItems>
7 <operation>with</operation>
8 <primaryTableColumn>ACCOUNT_ID</primaryTableColumn>
9 <relatedTable>Case</relatedTable>
10 <relatedTableJoinColumn>Account</relatedTableJoinColumn>
11 </crossFilters>UserDateInterval
An enumeration of type string that defines the period of time. Valid values:
| Enumeration Value | Description |
|---|---|
| INTERVAL_CURRENT | Current fiscal quarter |
| INTERVAL_CURNEXT1 | Current and next fiscal quarters |
| INTERVAL_CURPREV1 | Current and previous fiscal quarters |
| INTERVAL_NEXT1 | Next fiscal quarter |
| INTERVAL_PREV1 | Previous fiscal quarter |
| INTERVAL_CURNEXT3 | Current and next three fiscal quarters |
| INTERVAL_CURFY | Current fiscal year |
| INTERVAL_PREVFY | Previous fiscal year |
| INTERVAL_PREV2FY | Previous two fiscal years |
| INTERVAL_AGO2FY | Two fiscal years ago |
| INTERVAL_NEXTFY | Next fiscal year |
| INTERVAL_PREVCURFY | Current and previous fiscal years |
| INTERVAL_PREVCUR2FY | Current and previous two fiscal years |
| INTERVAL_CURNEXTFY | Current and next fiscal year |
| INTERVAL_CUSTOM | A custom time period. Use startDate and endDate fields to specify the time period's start date and end date. |
| INTERVAL_YESTERDAY | Yesterday |
| INTERVAL_TODAY | Today |
| INTERVAL_TOMORROW | Tomorrow |
| INTERVAL_LASTWEEK | Last calendar week |
| INTERVAL_THISWEEK | This calendar week |
| INTERVAL_NEXTWEEK | Next calendar week |
| INTERVAL_LASTMONTH | Last calendar month |
| INTERVAL_THISMONTH | This calendar month |
| INTERVAL_NEXTMONTH | Next calendar month |
| INTERVAL_LASTTHISMONTH | Current and previous calendar months |
| INTERVAL_THISNEXTMONTH | Current and next calendar months |
| INTERVAL_CURRENTQ | Current calendar quarter |
| INTERVAL_CURNEXTQ | Current and next calendar quarters |
| INTERVAL_CURPREVQ | Current and previous calendar quarters |
| INTERVAL_NEXTQ | Next calendar quarter |
| INTERVAL_PREVQ | Previous calendar quarter |
| INTERVAL_CURNEXT3Q | Current and next three calendar quarters |
| INTERVAL_CURY | Current calendar year |
| INTERVAL_PREVY | Previous calendar year |
| INTERVAL_PREV2Y | Previous two calendar years |
| INTERVAL_AGO2Y | Two calendar years ago |
| INTERVAL_NEXTY | Next calendar year |
| INTERVAL_PREVCURY | Current and previous calendar years |
| INTERVAL_PREVCUR2Y | Current and previous two calendar years |
| INTERVAL_CURNEXTY | Current and next calendar years |
| INTERVAL_LAST7 | Last 7 days |
| INTERVAL_LAST30 | Last 30 days |
| INTERVAL_LAST60 | Last 60 days |
| INTERVAL_LAST90 | Last 90 days |
| INTERVAL_LAST120 | Last 120 days |
| INTERVAL_NEXT7 | Next 7 days |
| INTERVAL_NEXT30 | Next 30 days |
| INTERVAL_NEXT60 | Next 60 days |
| INTERVAL_NEXT90 | Next 90 days |
| INTERVAL_NEXT120 | Next 120 days |
| LAST_FISCALWEEK | When custom fiscal years are enabled: Last fiscal week |
| THIS_FISCALWEEK | When custom fiscal years are enabled: This fiscal week |
| NEXT_FISCALWEEK | When custom fiscal years are enabled: Next fiscal week |
| LAST_FISCALPERIOD | When custom fiscal years are enabled: Last fiscal period |
| THIS_FISCALPERIOD | When custom fiscal years are enabled: This fiscal period |
| NEXT_FISCALPERIOD | When custom fiscal years are enabled: Next fiscal period |
| LASTTHIS_FISCALPERIOD | When custom fiscal years are enabled: This fiscal period and last fiscal period |
| THISNEXT_FISCALPERIOD | When custom fiscal years are enabled: This fiscal period and next fiscal period |
| CURRENT_ENTITLEMENT_PERIOD | Current entitlement period |
| PREVIOUS_ENTITLEMENT_PERIOD | Previous entitlement period |
| PREVIOUS_TWO_ENTITLEMENT_PERIODS | Previous two entitlement periods |
| TWO_ENTITLEMENT_PERIODS_AGO | Two entitlement periods ago |
| CURRENT_AND_PREVIOUS_ENTITLEMENT_PERIOD | Current and previous entitlement period |
| CURRENT_AND_PREVIOUS_TWO_ENTITLEMENT_PERIODS | Current and previous two entitlement periods |
Declarative Metadata Sample Definition
A sample XML report definition:
1<?xml version="1.0" encoding="UTF-8"?>
2<Report xmlns="http://soap.sforce.com/2006/04/metadata">
3 <aggregates>
4 <acrossGroupingContext>CRT_Object__c$Id</acrossGroupingContext>
5 <calculatedFormula>PREVGROUPVAL(CRT_Object__c.Currency__c:AVG, CRT_Object__c.Id) *
6 PARENTGROUPVAL(CRT_Object__c.Number__c:MAX, CRT_Object__c.CreatedBy.Name,
7 COLUMN_GRAND_SUMMARY)/RowCount</calculatedFormula>
8 <datatype>number</datatype>
9 <developerName>FORMULA1</developerName>
10 <downGroupingContext>CRT_Object__c$CreatedBy</downGroupingContext>
11 <isActive>true</isActive>
12 <masterLabel>CurrCSF</masterLabel>
13 <scale>2</scale>
14 </aggregates>
15 <aggregates>
16 <acrossGroupingContext>CRT_Object__c$LastModifiedDate</acrossGroupingContext>
17 <calculatedFormula>IF(RowCount>10,
18 BLANKVALUE(ROUND(PREVGROUPVAL(CRT_Object__c.Currency__c:SUM,
19 CRT_Object__c.LastModifiedDate),3),
20 PARENTGROUPVAL(CRT_Object__c.Number__c:SUM, ROW_GRAND_SUMMARY,
21 CRT_Object__c.Id)) , 1000)</calculatedFormula>
22 <datatype>number</datatype>
23 <developerName>FORMULA2</developerName>
24 <downGroupingContext>GRAND_SUMMARY</downGroupingContext>
25 <isActive>true</isActive>
26 <masterLabel>numCSF</masterLabel>
27 <scale>2</scale>
28 </aggregates>
29 <buckets>
30 <bucketType>number</bucketType>
31 <developerName>BucketField_BusinessSize</developerName>
32 <masterLabel>NumericBucket</masterLabel>
33 <nullTreatment>z</nullTreatment>
34 <sourceColumnName>SALES</sourceColumnName>
35 <values>
36 <sourceValues>
37 <to>10000</to>
38 </sourceValues>
39 <value>low</value>
40 </values>
41 <values>
42 <sourceValues>
43 <from>10000</from>
44 <to>25000</to>
45 </sourceValues>
46 <value>mid</value>
47 </values>
48 <values>
49 <sourceValues>
50 <from>25000</from>
51 </sourceValues>
52 <value>high</value>
53 </values>
54 </buckets>
55 <buckets>
56 <bucketType>text</bucketType>
57 <developerName>BucketField_Region</developerName>
58 <masterLabel>TextBucket</masterLabel>
59 <nullTreatment>n</nullTreatment>
60 <otherBucketLabel>Other</otherBucketLabel>
61 <sourceColumnName>ADDRESS1_STATE</sourceColumnName>
62 <values>
63 <sourceValues>
64 <sourceValue>CA</sourceValue>
65 </sourceValues>
66 <value>west</value>
67 </values>
68 <values>
69 <sourceValues>
70 <sourceValue>NY</sourceValue>
71 </sourceValues>
72 <sourceValues>
73 <sourceValue>Ontario</sourceValue>
74 </sourceValues>
75 <value>east</value>
76 </values>
77 </buckets>
78 <chart>
79 <backgroundColor1>#FFFFFF</backgroundColor1>
80 <backgroundColor2>#FFFFFF</backgroundColor2>
81 <backgroundFadeDir>Diagonal</backgroundFadeDir>
82 <chartSummaries>
83 <axisBinding>y</axisBinding>
84 <column>FORMULA1</column>
85 </chartSummaries>
86 <chartSummaries>
87 <axisBinding>y</axisBinding>
88 <column>FORMULA2</column>
89 </chartSummaries>
90 <chartSummaries>
91 <aggregate>Maximum</aggregate>
92 <axisBinding>y</axisBinding>
93 <column>CRT_Object__c$Number__c</column>
94 </chartSummaries>
95 <chartSummaries>
96 <axisBinding>y</axisBinding>
97 <column>RowCount</column>
98 </chartSummaries>
99 <chartType>VerticalColumn</chartType>
100 <groupingColumn>CRT_Object__c$LastModifiedDate</groupingColumn>
101 <legendPosition>Right</legendPosition>
102 <location>CHART_TOP</location>
103 <size>Medium</size>
104 <summaryAxisRange>Auto</summaryAxisRange>
105 <textColor>#000000</textColor>
106 <textSize>12</textSize>
107 <titleColor>#000000</titleColor>
108 <titleSize>18</titleSize>
109 </chart>
110 <columns>
111 <field>CRT_Object__c$Name</field>
112 </columns>
113 <columns>
114 <aggregateTypes>Average</aggregateTypes>
115 <field>CRT_Object__c$Currency__c</field>
116 </columns>
117 <columns>
118 <aggregateTypes>Maximum</aggregateTypes>
119 <field>CRT_Object__c$Number__c</field>
120 </columns>
121 <columns>
122 <field>BucketField__Region</field>
123 </columns>
124 <format>Matrix</format>
125 <groupingsAcross>
126 <dateGranularity>Day</dateGranularity>
127 <field>CRT_Object__c$Id</field>
128 <sortOrder>Asc</sortOrder>
129 </groupingsAcross>
130 <groupingsAcross>
131 <dateGranularity>Year</dateGranularity>
132 <field>CRT_Object__c$LastModifiedDate</field>
133 <sortOrder>Asc</sortOrder>
134 </groupingsAcross>
135 <groupingsDown>
136 <dateGranularity>Day</dateGranularity>
137 <field>CRT_Object__c$CreatedBy</field>
138 <sortOrder>Asc</sortOrder>
139 </groupingsDown>
140 <groupingsDown>
141 <dateGranularity>Day</dateGranularity>
142 <field>CRT_Object__c$Currency__c</field>
143 <sortOrder>Desc</sortOrder>
144 </groupingsDown>
145 <name>CrtMMVC</name>
146 <reportType>CRT1__c</reportType>
147 <scope>organization</scope>
148 <showDetails>false</showDetails>
149 <timeFrameFilter>
150 <dateColumn>CRT_Object__c$CreatedDate</dateColumn>
151 <interval>INTERVAL_CUSTOM</interval>
152 </timeFrameFilter>
153</Report>Declarative Metadata Sample Definition for a Joined Report
A sample XML report definition:
1<?xml version="1.0" encoding="UTF-8"?>
2<Report xmlns="http://soap.sforce.com/2006/04/metadata">
3<!-- This is a cross-block custom summary formula. Note that the calculated formula reference for a blocks reference uses the BlockId#Aggregate. -->
4 <aggregates>
5 <calculatedFormula>B1#AMOUNT:SUM+B2#EMPLOYEES:SUM</calculatedFormula>
6 <datatype>number</datatype>
7 <developerName>FORMULA</developerName>
8 <isActive>true</isActive>
9 <isCrossBlock>true</isCrossBlock>
10 <masterLabel>Cross-Block CSF Example</masterLabel>
11 <scale>2</scale>
12 </aggregates>
13<!-- This is a standard custom summary formula. Note that the calculated formula reference does not have block reference but just the aggregate name of the report type associated (Opportunity).-->
14 <aggregates>
15 <calculatedFormula>AMOUNT:SUM</calculatedFormula>
16 <developerName>FORMULA2</developerName>
17 <isActive>true</isActive>
18 <isCrossBlock>false</isCrossBlock>
19 <masterLabel>Standard CSF Example</masterLabel>
20 <reportType>Opportunity</reportType>
21 <scale>2</scale>
22 </aggregates>
23 <block>
24 <blockInfo>
25<!-- This is how the block defines that the custom summary formula should be referenced. In this example, it’s the in standard FORMULA 2 defined above. This block report has blockID B1.-->
26 <aggregateReferences>
27 <aggregate>FORMULA2</aggregate>
28 </aggregateReference>
29 <blockId>B1</blockId>
30 <joinTable>a</joinTable>
31 </blockInfo>
32 <columns>
33 <field>TYPE</field>
34 </columns>
35 <format>Summary</format>
36 <name>Opportunities BLock 3</name>
37 <params>
38 <name>role_territory</name>
39 <value>role</value>
40 </params>
41 <params>
42 <name>terr</name>
43 <value>all</value>
44 </params>
45 <params>
46 <name>open</name>
47 <value>all</value>
48 </params>
49 <params>
50 <name>probability</name>
51 <value>0</value>
52 </params>
53 <params>
54 <name>co</name>
55 <value>1</value>
56 </params>
57 <reportType>Opportunity</reportType>
58 <scope>organization</scope>
59 <timeFrameFilter>
60 <dateColumn>CLOSE_DATE</dateColumn>
61 <interval>INTERVAL_CUSTOM</interval>
62 </timeFrameFilter>
63 </block>
64 <block>
65 <blockInfo>
66<!-- This is how the block defines that the custom summary formula should be referenced. In this example, it’s the cross-block custom summary formula FORMULA 1 defined above. This block report has blockId B2.-->
67 <aggregateReferences>
68 <aggregate>FORMULA1</aggregate>
69 </aggregateReferences>
70 <blockId>B2</blockId>
71 <joinTable>a</joinTable>
72 </blockInfo>
73 <columns>
74 <field>USERS.NAME</field>
75 </columns>
76 <columns>
77 <field>TYPE</field>
78 </columns>
79 <columns>
80 <field>DUE_DATE</field>
81 </columns>
82 <columns>
83 <field>LAST_UPDATE</field>
84 </columns>
85 <columns>
86 <field>ADDRESS1_STATE</field>
87 </columns>
88 <format>Summary</format
89 <name>Accounts block 5</name>
90 <params>
91 <name>terr</name>
92 <value>all</value>
93 </params>
94 <params>
95 <name>co</name>
96 <value>1</value>
97 </params>
98 <reportType>AccountList</reportType>
99 <scope>organization</scope>
100 <timeFrameFilter>
101 <dateColumn>CREATED_DATE</dateColumn>
102 <interval>INTERVAL_CUSTOM</interval>
103 </timeFrameFilter>
104 </block>
105 <blockInfo>
106 <blockId xsi:nil="true"/>
107 <joinTable>a</joinTable>
108 </blockInfo>
109<chart>
110 <backgroundColor1>#FFFFFF</backgroundColor1>
111 <backgroundColor2>#FFFFFF</backgroundColor2>
112 <backgroundFadeDir>Diagonal</backgroundFadeDir>
113 <chartSummaries>
114 <axisBinding>y</axisBinding>
115<!-- This is how chart aggregates are designed in multiblock. We're using RowCount from Block 1.-->
116 <column>B1#RowCount</column>
117 </chartSummaries>
118 <chartType>HorizontalBar</chartType>
119 <enableHoverLabels>false</enableHoverLabels>
120 <expandOthers>true</expandOthers>
121 <groupingColumn>ACCOUNT_NAME</groupingColumn>
122 <location>CHART_TOP</location>
123 <showAxisLabels>true</showAxisLabels>
124 <showPercentage>false</showPercentage>
125 <showTotal>false</showTotal>
126 <showValues>false</showValues>
127 <size>Medium</size>
128 <summaryAxisRange>Auto</summaryAxisRange>
129 <textColor>#000000</textColor>
130 <textSize>12</textSize>
131 <titleColor>#000000</titleColor>
132 <titleSize>18</titleSize>
133 </chart>
134 <format>MultiBlock</format>
135 <groupingsDown>
136 <dateGranularity>Day</dateGranularity>
137 <field>ACCOUNT_NAME</field>
138 <sortOrder>Asc</sortOrder>
139 </groupingsDown>
140 <name>mb_mbapi</name>
141 <reportType>Opportunity</reportType>
142 <showDetails>true</showDetails>
143</Report>