ReportMetadata Class

Contains report metadata for a tabular, summary, or matrix report.

Reports

Report metadata gives information about the report as a whole, such as the report type, format, summary fields, row or column groupings, and filters that are saved to the report. You can use the ReportMetadata class to retrieve report metadata and to set metadata that can be used to filter a report.

The following are methods for ReportMetadata. All are instance methods.

Returns unique identifiers for summary or custom summary formula fields in the report.

public LIST<String> getAggregates()

Type: List<String>

For example:

  • a!Amount represents the average for the Amount column.
  • s!Amount represents the sum of the Amount column.
  • m!Amount represents the minimum value of the Amount column.
  • x!Amount represents the maximum value of the Amount column.
  • s!<customfieldID> represents the sum of a custom field column. For custom fields and custom report types, the identifier is a combination of the summary type and the field ID.

Returns a list of bucket fields in the report.

public List<Reports.BucketField> getBuckets()

Type: List<Reports.BucketField>

Returns information about cross filters applied to a report.

public Reports.CrossFilter getCrossFilters()

Type: List<Reports.CrossFilter>

Returns report currency, such as USD, EUR, or GBP, for an organization that has multicurrency enabled. The value is null if the organization does not have multicurrency enabled.

public String getCurrencyCode()

Type: String

Returns information about custom summary formulas in a report.

public Map<String,Reports.ReportCsf> getCustomSummaryFormula()

Type: Map<String,Reports.ReportCsf>

Returns the description of the report.

public String getDescription()

Type: String

Returns unique API names (column names) for the fields that contain detailed data. For example, the method might return the following values: “OPPORTUNITY_NAME, TYPE, LEAD_SOURCE, AMOUNT.”

public LIST<String> getDetailColumns()

Type: List<String>

Returns the report API name. For example, the method might return the following value: “Closed_Sales_This_Quarter.”

public String getDeveloperName()

Type: String

Returns the division specified in the report.

Reports that use standard filters (such as My Cases or My Team’s Accounts) show records in all divisions. These reports can’t be further limited to a specific division.

public String getDivision()

Type: String

Returns column groupings in a report.

public LIST<Reports.GroupingInfo> getGroupingsAcross()

Type: List<Reports.GroupingInfo>

The identifier is:

  • An empty array for reports in summary format, because summary reports don’t include column groupings
  • BucketField_(ID) for bucket fields, where ID is a placeholder value.
  • The ID of a custom field when the custom field is used for a column grouping

Returns row groupings for a report.

public LIST<Reports.GroupingInfo> getGroupingsDown()

Type: List<Reports.GroupingInfo>

The identifier is:

  • BucketField_(ID) for bucket fields, where ID is a placeholder value.
  • The ID of a custom field when the custom field is used for grouping

Indicates whether the report has detail rows.

public Boolean getHasDetailRows()

Type: Boolean

Indicates whether the report shows the total number of records.

public Boolean getHasRecordCount()

Type: Boolean

Returns a list of historical snapshot dates.

public LIST<String> getHistoricalSnapshotDates()

Type: List<String>

Returns the unique report ID.

public Id getId()

Type: Id

Returns the report name.

public String getName()

Type: String

Returns logic to parse custom field filters. The value is null when filter logic is not specified.

public String getReportBooleanFilter()

Type: String

Returns a list of each custom filter in the report along with the field name, filter operator, and filter value.

public LIST<Reports.ReportFilter> getReportFilters()

Type: List<Reports.ReportFilter>

Returns the format of the report.

public Reports.ReportFormat getReportFormat()

Type: Reports.ReportFormat

This value can be:

  • TABULAR
  • SUMMARY
  • MATRIX

Returns the unique API name and display name for the report type.

public Reports.ReportType getReportType()

Type: Reports.ReportType

Returns the API name for the scope defined for the report. Scope values depend on the report type.

public String getScope()

Type: String

Indicates whether the report shows the grand total.

public Boolean getShowGrandTotal()

Type: Boolean

Indicates whether the report shows subtotals, such as column or row totals.

public Boolean getShowSubtotals()

Type: Boolean

Returns the list of columns on which the report is sorted. Currently, you can sort on only one column.

public List<Reports.SortColumn> getSortBy()

Type: List<Reports.SortColumn>

Returns information about the standard date filter for the report, such as the start date, end date, date range, and date field API name.

public Reports.StandardDateFilter getStandardDateFilter()

Type: Reports.StandardDateFilter

Returns a list of standard filters for the report.

public List<Reports.StandardFilter> getStandardFilters()

Type: List<Reports.StandardFilter>

Returns information about a row limit filter, including the number of rows returned and the sort order.

public Reports.TopRows getTopRows()

Type: Reports.TopRows

Sets unique identifiers for standard or custom summary formula fields in the report.

public void setAggregates(List<String> aggregates)

  • aggregates:

    Type: List<String>

Type: void

Creates bucket fields in a report.

public void setBuckets(List<Reports.BucketField> buckets)

Type: void

Applies cross filters to a report.

public void setCrossFilters(List<Reports.CrossFilter> crossFilters)

Type: void

Sets the currency, such as USD, EUR, or GBP, for report summary fields in an organization that has multicurrency enabled.

public void setCurrencyCode(String currencyCode)

Type: void

Adds a custom summary formula to a report.

public void setCustomSummaryFormula(MAP<String,Reports.ReportCsf> customSummaryFormula)

Type: void

Sets the description of the report.

public void setDescription(String description)

Type: void

Sets the unique API names for the fields that contain detailed data—for example, OPPORTUNITY_NAME, TYPE, LEAD_SOURCE, or AMOUNT.

public void setDetailColumns(List<String> detailColumns)

  • detailColumns:

    Type: List<String>

Type: void

Sets the report API name—for example, Closed_Sales_This_Quarter.

public void setDeveloperName(String developerName)

Type: void

Sets the division of the report.

Reports that use standard filters (such as My Cases or My Team’s Accounts) show records in all divisions. These reports can’t be further limited to a specific division.

public void setDivision(String division)

Type: void

Sets column groupings in a report.

public void setGroupingsAcross(List<Reports.GroupingInfo> groupingInfo)

Type: void

Sets row groupings for a report.

public void setGroupingsDown(List<Reports.GroupingInfo> groupingInfo)

Type: void

Specifies whether the report has detail rows.

public void setHasDetailRows(Boolean hasDetailRows)

Type: void

Specifies whether the report is configured to show the total number of records.

public void setHasRecordCount(Boolean hasRecordCount)

Type: void

Sets a list of historical snapshot dates.

public Void setHistoricalSnapshotDates(LIST<String> historicalSnapshot)

Type: Void

Sets the unique report ID.

public void setId(Id id)

  • id:

    Type: Id

Type: void

Sets the report name.

public void setName(String name)

Type: void

Sets logic to parse custom field filters.

public Void setReportBooleanFilter(String reportBooleanFilter)

  • reportBooleanFilter:

    Type: String

Type: Void

Sets a list of each custom filter in the report along with the field name, filter operator, and filter value.

public Void setReportFilters(LIST<Reports.ReportFilter> reportFilters)

Type: Void

Sets the format of the report.

public void setReportFormat(Reports.ReportFormat format)

Type: void

Sets the unique API name and display name for the report type.

public void setReportType(Reports.ReportType reportType)

Type: void

Sets the API name for the scope defined for the report. Scope values depend on the report type.

public void setScope(String scopeName)

Type: void

Specifies whether the report shows the grand total.

public void setShowGrandTotal(Boolean showGrandTotal)

Type: void

Specifies whether the report shows subtotals, such as column or row totals.

public void setShowSubtotals(Boolean showSubtotals)

Type: void

Sets the list of columns on which the report is sorted. Currently, you can only sort on one column.

public void setSortBy(List<Reports.SortColumn> column)

Type: void

Sets the standard date filter—which includes the start date, end date, date range, and date field API name—for the report.

public void setStandardDateFilter(Reports.StandardDateFilter dateFilter)

Type: void

Sets one or more standard filters on the report.

public void setStandardFilters(List<Reports.StandardFilter> filters)

Type: void

Applies a row limit filter to a report.

public Reports.TopRows setTopRows(Reports.TopRows topRows)

Type: void