ReportMetadata Class
Contains report metadata for a tabular, summary, or matrix report.
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.
-
Returns a list of bucket fields in the report.
-
Returns information about cross filters applied to a report.
-
Returns report currency, such as USD, EUR, or GBP, for an organization that has multicurrency enabled. The value is
nullif the organization does not have multicurrency enabled. -
Returns information about custom summary formulas in a report.
-
Returns the description of the report.
-
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.”
-
Returns the report API name. For example, the method might return the following value: “Closed_Sales_This_Quarter.”
-
Returns the division specified in the report.
-
Returns column groupings in a report.
-
Returns row groupings for a report.
-
Indicates whether the report has detail rows.
-
Indicates whether the report shows the total number of records.
-
Returns a list of historical snapshot dates.
-
Returns the unique report ID.
-
Returns the report name.
-
Returns logic to parse custom field filters. The value is
nullwhen filter logic is not specified. -
Returns a list of each custom filter in the report along with the field name, filter operator, and filter value.
-
Returns the format of the report.
-
Returns the unique API name and display name for the report type.
-
Returns the API name for the scope defined for the report. Scope values depend on the report type.
-
Indicates whether the report shows the grand total.
-
Indicates whether the report shows subtotals, such as column or row totals.
-
Returns the list of columns on which the report is sorted. Currently, you can sort on only one column.
-
Returns information about the standard date filter for the report, such as the start date, end date, date range, and date field API name.
-
Returns a list of standard filters for the report.
-
Returns information about a row limit filter, including the number of rows returned and the sort order.
-
Sets unique identifiers for standard or custom summary formula fields in the report.
-
Creates bucket fields in a report.
-
Applies cross filters to a report.
-
Sets the currency, such as USD, EUR, or GBP, for report summary fields in an organization that has multicurrency enabled.
-
setCustomSummaryFormula(customSummaryFormula)
Adds a custom summary formula to a report.
-
Sets the description of the report.
-
setDetailColumns(detailColumns)
Sets the unique API names for the fields that contain detailed data—for example,
OPPORTUNITY_NAME,TYPE,LEAD_SOURCE, orAMOUNT. -
setDeveloperName(developerName)
Sets the report API name—for example,
Closed_Sales_This_Quarter. -
Sets the division of the report.
-
setGroupingsAcross(groupingInfo)
Sets column groupings in a report.
-
setGroupingsDown(groupingInfo)
Sets row groupings for a report.
-
setHasDetailRows(hasDetailRows)
Specifies whether the report has detail rows.
-
setHasRecordCount(hasRecordCount)
Specifies whether the report is configured to show the total number of records.
-
setHistoricalSnapshotDates(historicalSnapshot)
Sets a list of historical snapshot dates.
-
Sets the unique report ID.
-
Sets the report name.
-
setReportBooleanFilter(reportBooleanFilter)
Sets logic to parse custom field filters.
-
setReportFilters(reportFilters)
Sets a list of each custom filter in the report along with the field name, filter operator, and filter value.
-
Sets the format of the report.
-
Sets the unique API name and display name for the report type.
-
Sets the API name for the scope defined for the report. Scope values depend on the report type.
-
setShowGrandTotal(showGrandTotal)
Specifies whether the report shows the grand total.
-
setShowSubtotals(showSubtotals)
Specifies whether the report shows subtotals, such as column or row totals.
-
Sets the list of columns on which the report is sorted. Currently, you can only sort on one column.
-
setStandardDateFilter(dateFilter)
Sets the standard date filter—which includes the start date, end date, date range, and date field API name—for the report.
-
Sets one or more standard filters on the report.
-
Applies a row limit filter to a report.
Returns unique identifiers for summary or custom summary formula fields in the report.
public LIST<String> getAggregates()
For example:
a!Amountrepresents the average for theAmountcolumn.s!Amountrepresents the sum of theAmountcolumn.m!Amountrepresents the minimum value of theAmountcolumn.x!Amountrepresents the maximum value of theAmountcolumn.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()
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()
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:
TABULARSUMMARYMATRIX
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)
-
buckets:
Type: List<Reports.BucketField>
Type: void
Applies cross filters to a report.
public void setCrossFilters(List<Reports.CrossFilter> crossFilters)
-
crossFilter:
Type: List<Reports.CrossFilter>
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)
-
currencyCode:
Type: String
Type: void
Adds a custom summary formula to a report.
public void setCustomSummaryFormula(MAP<String,Reports.ReportCsf> customSummaryFormula)
-
customSummaryFormula:
Type: Map<String, Reports.ReportCsf>
Type: void
Sets the description of the report.
public void setDescription(String description)
-
description:
Type: String
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)
-
developerName:
Type: String
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)
-
division:
Type: String
Type: void
Sets column groupings in a report.
public void setGroupingsAcross(List<Reports.GroupingInfo> groupingInfo)
-
groupingInfo:
Type: List<Reports.GroupingInfo>
Type: void
Sets row groupings for a report.
public void setGroupingsDown(List<Reports.GroupingInfo> groupingInfo)
-
groupingInfo:
Type: List<Reports.GroupingInfo>
Type: void
Specifies whether the report has detail rows.
public void setHasDetailRows(Boolean hasDetailRows)
-
hasDetailRows:
Type: Boolean
Type: void
Specifies whether the report is configured to show the total number of records.
public void setHasRecordCount(Boolean hasRecordCount)
-
hasRecordCount:
Type: Boolean
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)
-
name:
Type: String
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)
-
reportFilters:
Type: List<Reports.ReportFilter>
Type: Void
Sets the format of the report.
public void setReportFormat(Reports.ReportFormat format)
-
format:
Type: Reports.ReportFormat
Type: void
Sets the unique API name and display name for the report type.
public void setReportType(Reports.ReportType reportType)
-
reportType:
Type: Reports.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)
-
scopeName:
Type: String
Type: void
Specifies whether the report shows the grand total.
public void setShowGrandTotal(Boolean showGrandTotal)
-
showGrandTotal:
Type: Boolean
Type: void
Specifies whether the report shows subtotals, such as column or row totals.
public void setShowSubtotals(Boolean showSubtotals)
-
showSubtotals:
Type: Boolean
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)
-
column:
Type: List<Reports.SortColumn>
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)
-
dateFilter:
Type: void
Sets one or more standard filters on the report.
public void setStandardFilters(List<Reports.StandardFilter> filters)
-
filters:
Type: List<Reports.StandardFilter>
Type: void
Applies a row limit filter to a report.
public Reports.TopRows setTopRows(Reports.TopRows topRows)
-
topRows:
Type: Reports.TopRows
Type: void