Determining the available rollup keys

The Presentation API has methods and properties to retrieve rollup keys.

Assuming that you have a navigation state, the following objects and calls are used to determine the available rollup keys. These rollup keys can be used in subsequent queries to generate aggregated records:
The rollup keys are retrieved from the Navigation object in an ERecRollupKeyList object. Each ERecRollupKey in this list contains the name and active status of the rollup key:

The following code fragments show how to retrieve a list of rollup keys, iterate over them, and display the names of keys that are active in the current navigation state.

Java example for getting rollup keys

// Get rollup keys from the Navigation object
ERecRollupKeyList rllupKeys = nav.getRollupKeys();
// Loop through rollup keys
for (int i=0; i< rllupKeys.size(); i++) {
  // Get a rollup key from the list
  ERecRollupKey rllupKey = rllupKeys.getKey(i);
  // Display the key name if the key is active. 
  if (rllupKey.isActive()) {
    %>Active rollup key: <%= rllupKey.getName() %><%
  }
}

.NET example for getting rollup keys

// Get rollup keys from the Navigation object
ERecRollupKeyList rllupKeys = nav.RollupKeys;
// Loop through rollup keys
for (int i=0; i< rllupKeys.Count; i++) {
  // Get a rollup key from the list
  ERecRollupKey rllupKey = (ERecRollupKey)rllupKeys[i];
  // Display the key name if the key is active. 
  if (rllupKey.IsActive()) {
    %>Active rollup key: <%= rllupKey.Name %><%
  }
}