Newer Version Available

This content describes an older version of this product. View Latest

FlatList Class

Represents a Real Time Reporting (RTR) report UI Flatlist component. This class extends the ReportComponent class.

Namespace

CGCloud

Usage

The RTRReportResult.FlatList class is used to access Flatlist information from RTR reports.

Example

Here’s an example of how to extract the Flatlist data from the RTRReportResult object.
1// Extract the Flatlist from the result
2// - The component name must match its 'uimapping' name
3// - The result must be casted to the correct type.
4cgcloud.RTRReportResult.Flatlist flatlist = (cgcloud.RTRReportResult.Flatlist) 
5    reportResult.getComponent('FlatList');
6    
7// Retrieve the rows Iterable object
8// All rows can be retrieved with the parameter-less "getRows"
9cgcloud.RTRReportResult.FlatlistRowIterable iterator = flatlist.getRows('Promo-Product');
10
11// Iterate over all the rows
12while (iterator.hasNext()) {
13    cgcloud.RTRReportResult.FlatlistRow row = iterator.next();
14    
15    // Extract column data. We assume the specified columns are in the report
16    
17    // Dimension information can be extracted with <dimension name>.<field>
18    String promotionId = String.valueOf(row.getColumnValue('promotiondimension.id'));
19    // KPI Value information can be extracted by querying the KPI Name
20    Decimal kpiValue = (Decimal) row.getColumnValue('ProPlanIncrVolume');
21    
22    system.debug('Values: ' + promotionId + ' ' + kpiValue);
23}

FlatList Methods

The following are methods for FlatList.

getRows()

Returns an instance of a FlatlistRowIterable object with all the rows contained in the Flatlist.

Signature

static RTRReportResult.FlatList getRows()

Return Value

Type:FlatlistRowIterable

getRows(String rowTypeFilter)

Returns an instance of a FlatlistRowIterable object with all the rows that match the specified row type filter. The available values for the row type filter can be extracted with the getRowTypes method.

Signature

static RTRReportResult.FlatList getRows(String rowTypeFilter)

Parameters

rowTypeFilter
Type:String
The value of the row type to filter the rows.

Return Value

Type:FlatlistRowIterable

getColumns()

Returns a set that includes all the available column names in the Flatlist.
The method returns the following:
  • Dimension attributes—Include the name of the dimension and a report field separated by a dot. For example, productdimension.id, promotiondimension.id, and promotiondimension.phase.
  • KPI columns—Include the KPI name. For example, ProPlanIncrVolume.

Signature

static RTRReportResult.FlatList getColumns()

Return Value

Type:Set<String>

getRowTypes()

Returns all the available row type filters present in the Flatlist. The row type filters can be used to filter the dataset.

Signature

static RTRReportResult.FlatList getRowTypes()

Return Value

Type:Set<String>