Reporting Templates API Reference
These are the available methods to create and modify reporting templates.
Common Methods
The following methods are available for both Summary and Detail reports:
| Name | Arguments | Return Type | Description |
|---|---|---|---|
| AllowExpandCollapse | Boolean | Returns true or false depending on whether the Allow Expand and Collapse checkbox in the Definition Options is selected or not. | |
| CompanyLogo | String | Returns the image name defined in the report definition, or an empty string. | |
| CurrencySymbol | String | Returns the currency symbol of the report if the Display Currency Symbol checkbox is selected. Otherwise, the currency symbol is not displayed. | |
| DetailType | String | Returns "DETAIL". Use it to check Data Range type. Create an outputpanel, rendered only if dataRange is Detail:
<apex:outputpanel rendered="{!dataRange.TypeName == DetailType}"> |
|
| DisplayCompanyLogo | Boolean | Returns true or false depending on whether the Logo Image field in Reporting Options is completed or not. | |
| DisplayExpandCollapse | Boolean | Returns true if the report is run in view mode and the Allow Expand and Collapse checkbox is selected. Otherwise, returns false. | |
| HasDrillConfiguration | Boolean | Returns true if drill configuration has been set up for the report. Otherwise, returns false. | |
| HasMessages | Boolean | Returns true or false, depending on whether an error or warning message has been generated during report execution or not. | |
| IsViewMode | Boolean | Returns true if the report is not exported or saved to PDF or Excel. Otherwise, returns false. | |
| Label | String key | String | Returns the Label defined in the report definition, given its key label. Get label keyed by "˜L80':
{!label['L80']} |
| NumberFormatPattern | String | Deprecated | |
| PrintChatterFeed | Boolean | Returns true or false depending on whether the Print Chatter Feed checkbox in Report Options is selected or not. | |
| PromptList | List<Prompt> | Returns the Prompts collection defined in the report definition. | |
| RenderReportAs | String | Returns "pdf" in case the report has been run using Print or Save as PDF, null otherwise. | |
| ReportingData | String key | ReportingData | Returns reporting data, given its template key. Get the reporting data keyed by "˜DR01':
<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/> |
| ReportingDataKeyList | List<String> | Returns the template key collection for the data ranges. Loop through all data ranges defined in the report definition:
<apex:repeat value="{!reportingDataKeyList}" var="reportingDataKey"><apex:variable var="dataRange" value="{!reportingData[reportingDataKey]}"/> |
|
| ReportingDataList | List <ReportingData> | Returns reporting data list included in the report definition. Loop through all data ranges defined in the Report Definition:
<apex:repeat value="{!reportingDataList}" var="reportingData"> |
|
| ReportingDataRangeLabels | String key | String | Returns the reporting data label, given its template key: Get the data range label, keyed by "˜DR01':
<apex:variable var="dataRangeName" value="{!reportingDataRangeLabels["˜DR01']}"/> |
| ReportingDataRanges | String key | ReportingDataRange__c | Returns a reporting data range , given its template key. Get the data range keyed by "˜DR01':
<apex:variable var="dataRange" value="{!reportingDataRanges["˜DR01']}"/> |
| ReportingLog | ID | Returns Reporting Log Id in case the report is run from an existing one. Otherwise returns null. | |
| SaveReportAs | String | Returns "pdf" or "xls", depending on the option chosen when saving the report. | |
| SortLabelList | List<String> | Returns the collection of Labels defined for the report definition, sorted by key label. | |
| StaticResourceImages | String | Returns default document folder containing images used in the report. | |
| StyleSheetName | String | Returns the CSS stylesheet name applied to the report. Depends on the way the report has been executed, and on View and Print Style Sheet field values. | |
| SummaryType | String | Returns "SUMMARY". Use it to check Data Range type.
<apex:outputpanel rendered="{!dataRange.TypeName == SummaryType}"> |
|
| TypeDate | String | Returns "DATE". Use it to check data types. Create a td with different style, depending on column data type:
<td class="{!IF(column.Type == TypeDate || column.Type == DataType.Datetime, 'dateStyle', 'otherTypesStyle')}"> |
|
| TypeDatetime | String | Returns "DATETIME". Use it to checkdata types. See example above. | |
| TypeDouble | String | Returns "DOUBLE". Use it to check data types. See example above. | |
| TypeInteger | String | Returns "INTEGER". Use it to check data types. See example above. | |
| TypeString | String | Returns "STRING". Use it to check data types. See example above. | |
| TypeZero | String | Returns "ZERO". Use it to check data types. See example above. |
Prompts
The following methods are prompt-specific. They are also common to both Summary and Detail reports. Before using these methods, you must obtain them using a PromptList call.
| Name | Arguments | Return Type | Description |
|---|---|---|---|
| Value | String | Returns the value given to the Prompt by the user in the current report execution. | |
| Label | String | Returns the prompt's label. |
Summary Reporting
The following methods are accessible after retrieving a ReportingData object either via ReportingDataList or ReportingData calls, and as long as the ReportingData is Summary type. One ReportingData object exists for each Data Range defined in the Report Definition.
| Name | Arguments | Return Type | Description |
|---|---|---|---|
| ColumnKeyList | String | Returns the template key collection of all Columns specified in the data range. | |
| ColumnLabelList | List<String> | Returns Columns' labels collection. Loop through the columns' labels defined in the DataRange keyed by "˜DR01':
<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:repeat value="{!dataRange.ColumnLabelList}" var="label"> |
|
| ColumnLabels | String key | String | Returns a column's label, given related column's template key. Get the Reporting Data keyed by "˜DR01', then retrieve column label keyed by "˜A':<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:outputText value="{!dataRange.columnLabels["˜A']}"/> |
| CountLabelList | List<String> | Returns count fields' labels collection. Loop through count fields' labels defined in the DataRange keyed by "˜DR01':<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:repeat value="{!dataRange.CountLabelList}" var="label"> |
|
| CountLabels | String key | String | Returns a count field's label, given count field's template key. Get the Reporting Data keyed by "˜DR01', then retrieve count field label keyed by "˜A':<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:outputText value="{!dataRange.countLabels["˜A']}"/> |
| DrillUrl | String | Returns the drill down URL for the column if drill configuration is setup. | |
| GroupLabelList | List<String> | Returns Groups' labels collection. Loop through the groups' labels defined in the DataRange keyed by "˜DR01':<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:repeat value="{!dataRange.GroupLabelList}" var="label"> |
|
| GroupLabels | String key | String | Returns a group's label, given group's template key. Get the Reporting Data keyed by "˜DR01', then retrieve group label keyed by "˜01':<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:outputText value="{!dataRange.groupLabels["˜01']}"/> |
| GroupKeyList | List<String> | Returns Groups' template key collection. Loop through groups defined in the DataRange keyed by "˜DR01' and accessing them using its template key:<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:repeat value="{!dataRange.GroupKeyList}" var="groupKey"/><apex:variable var="group" value="{!dataRange.Groups[groupKey]}"/> |
|
| RowKeyList | String | Returns the template key collection of all Rows created in the Data Range. | |
| RowList | List<Row> | Returns Rows' collection defined in the Data Range. Loop through the rows defined in the DataRange keyed by "˜DR01':<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:repeat value="{!dataRange.RowList}" var="row"> |
|
| Rows | String key | Row | Returns a Row defined in the Data Range, given its template key. Get the Summary Reporting Data keyed by "˜DR01', then retrieve Row keyed by "˜01':<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:variable var="row01" value="{!dataRange.Rows["˜01']}"/> |
| TypeName | String | Returns Summary Reporting Data type. | |
| ValueLabelList | List<String> | Returns Values' labels collection.Loop through the values' labels defined in the DataRange keyed by "˜DR01':<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:repeat value="{!dataRange.ValueLabelList}" var="label"> |
|
| ValueLabels | String key | String | Returns a value's label, given value's template key. Get the Reporting Data keyed by "˜DR01', then retrieve value label keyed by "˜A':<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:outputText value="{!dataRange.valueLabels["˜A']}"/> |
Rows
A certain Data Range has as many Rows as defined for Row type Filter Mappings. Before using the following methods, you must obtain a Row using either Rows or RowList calls:
| Name | Arguments | Return Type | Description |
|---|---|---|---|
| Key | String | Returns a row's key. | |
| Label | String | Returns a row's label. | |
| LineList | List<Line> | Returns Lines' collection included in the Row. Given a variable referencing a Row keyed by "˜01', loop through its Lines: <apex:variable var="row" value="{!reportingData["˜DR01'].Rows["˜01']}"/><apex:repeat value="{!row.lineList}" var="line"> |
|
| Lines | String key | Line | Returns a Line given its relative position in the collection. Accepts any position from 0 to row.Count - 1. |
Lines
A certain Row has a related list of Lines. Before using the following methods, you must obtain a Line using the LineList method which is usually looped to display all Row's Lines:
| Name | Arguments | Return Type | Description |
|---|---|---|---|
| ColumnList | List<Column> | Returns Columns' collection related to the Line. | |
| Columns | String key | Column | Returns a column, given column's template key. Given a variable referencing a Row keyed by "˜01', loop through its Lines and reference column A for each:<apex:variable var="row" value="{!reportingData["˜DR01'].Rows["˜01'}"/><apex:repeat value="{!row.lineList}" var="line"><apex:variable var="column" value="{!line.Columns["˜A']}" var="columnA"> |
| GenericGroupList | List <GroupingDisplay> | Returns GroupingDisplay objects' collection related to the Line. | |
| GenericGroups | String key | GroupingDisplay | Returns a GroupingDisplay object, given its template key. |
| GroupList | Deprecated | ||
| Groups | Deprecated |
GroupingDisplay
A Line has a related list of GroupingDisplay objects. This object allows grouping by any valid data type. Before using the following methods, you must obtain a GroupingDisplay object calling either GenericGroups or GenericGroupList. These methods replace Groups and GroupList methods from previous versions when creating new templates:
| Name | Arguments | Return Type | Description |
|---|---|---|---|
| Type | String | Returns SOAP Type of the value stored in the GroupingDisplay object. | |
| Value | Object | Returns the value stored by the GroupingDisplay object. |
Columns
A Line has a related list of Columns. A certain Data Range creates as many Columns as defined for Column type Filter Mappings. Therefore, all Rows within a Data Range share the number of Columns and its type. The same applies to all Lines within those Rows. Before using the following methods, you must obtain a Column object calling either Columns or ColumnList methods from the Line parent object:
| Name | Arguments | Return Type | Description |
|---|---|---|---|
| CountList | List<Integer> | Returns count values' collection stored by the Column. | |
| CountValues | String key | Integer | Returns count value related to the Count Reporting Value keyed by the given key. See the Values method below for an example. |
| Key | String | Returns Column's template key. | |
| Label | String | Returns Column's label. | |
| ValueList | List<Decimal> | Returns sum values' collection stored by the Column. | |
| Values | String key | Decimal | Returns sum value related to the Sum Reporting Value keyed by the given key. Display all sum values from all Data Ranges, Rows, Lines and Columns for a Report Definition:<apex:repeat value="{!reportingDataKeyList}" var="reportingDataKey"><apex:variable var="dataRange" value="{!reportingData[reportingDataKey]}"/><apex:repeat value="{!dataRange.rowList}" var="row" ><apex:repeat value="{!row.lineList}" var="line" ><apex:repeat value="{!line.columnList}" var="column"><apex:repeat value="{!column.valueList}" var="value"><c:Formatter value="{!value}" type="DOUBLE" numberPattern="{!VN}" zeroPattern="{!VZ}"/></apex:repeat> </apex:repeat> </apex:repeat> </apex:repeat> </apex:repeat> |
Detail Reporting
The following methods are accessible after retrieving a ReportingData object, either via ReportingDataList or ReportingData calls, and as long as the ReportingData is Detail type. One ReportingData object exists for each Data Range defined in the Report Definition.
| Name | Arguments | Return type | Description |
|---|---|---|---|
| Count | Integer | Returns count of all Lines included in all Rows related to the Data Range. | |
| ReportingValueKeyList | String | Returns the template key collection of all Reporting Values specified in the Data Range. | |
| ReportingValueList | List <ColumnAttribute> | Returns the ColumnAttribute collection for the Data Range. | |
| ReportingValues | String key | ColumnAttribute | Returns a ColumnAttribute object, given its template key. |
| RowList | List<Row> | Returns Rows' collection defined in the Data Range. Loop through the rows defined in the Data Range keyed by "˜DR01':<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:repeat value="{!dataRange.RowList}" var="row"> |
|
| Rows | String key | Row | Returns a Row defined in the Data Range, given its template key. Get the Detail Reporting Data keyed by "˜DR01', then retrieve Row keyed by "˜01':<apex:variable var="dataRange" value="{!reportingData["˜DR01']}"/><apex:variable var="row01" value="{!dataRange.Rows["˜01']}"/> |
| RowsNumber | Integer | Returns Data Range's Row count. | |
| TypeName | String | Returns Detail Reporting Data type. |
Rows
A certain Data Range has as many Rows as defined for Row type Filter Mappings. Before using the following methods, you must obtain a Row using either Rows or RowList calls:
| Name | Arguments | Return Type | Description |
|---|---|---|---|
| Count | Integer | Returns Row's Lines count. | |
| Key | String | Returns Row's key. | |
| Label | String | Returns Row's label. | |
| LineList | List<Line> | Returns Lines' collection included in the Row. Given a variable referencing a Row keyed by "˜01', loop through its Lines:<apex:variable var="row" value="{!reportingData["˜DR01'].Rows["˜01']}"/><apex:repeat value="{!row.lineList}" var="line"> |
|
| Lines | String key | Line | Returns a Line given its relative position in the collection. Accepts any position from 0 to row.Count - 1. |
Lines
A certain Row has a related list of Lines. Before using the following methods, you must obtain a Line using either Lines or LineList method. This is usually looped to display all Row's Lines:
| Name | Arguments | Return Type | Description |
|---|---|---|---|
| Values | String key | Object | Returns a value from the Line, given Reporting Value's template key. |
| ValuesList | List<Object> | Returns Line's values collection. |
ColumnAttributes
A certain Data Range creates as many ColumnAttributes as defined for Reporting Reporting Values. Therefore, all Rows within a Data Range share the number of ColumnAttributes and their type. Before using the following methods, you must obtain a ColumnAttribute object calling either ReportingValues or ReportingValueList methods from the Data Range parent object:
| Name | Arguments | Return Type | Description |
|---|---|---|---|
| Label | String | Returns Reporting Value's label related to this ColumnAttribute object. | |
| Key | String | Returns Reporting Value's template key related to this ColumnAttribute object. | |
| APIName | String | Returns Reporting Value's API Name related to this ColumnAttribute object. | |
| IsGroup | Boolean | Returns true if related Reporting Value is Group type, false otherwise. | |
| IsSum | Boolean | Returns true if related Reporting Value is Sum type, false otherwise. | |
| Type | String | Returns SOAP type of the field referenced by Reporting Value's APIName. |
SECTIONS