Add Method (Columns, Layers, Rows)

Adds one or more objects a collection, or to an object that maintains a list of other objects.

Syntax

collection.Add CategoryList [, NestingLevel]

Applies To

Columns

Layers

Rows

Discussion

Use this method to add the categories identified in a CategoryList object to the columns, layers, or rows of the report.

References to the position of an object in the collection are not valid after you use this method.

Parameters

Description

CategoryList

Required. Specifies the CategoryList object without having to identify the dimension if the category label is unique.

Type: Object

NestingLevel

Optional: A value indicating the nesting level to add the categories to.

Default: 0 (top level)

Type: Variant

Return Type

Object

Example

This example adds a new level of categories as layers to a report.

Sub Main()
   Dim objCubeCategories As Object
   Dim objPPRep As Object
   Const level_0 = 0
   Const level_1 = 1
   Const add_to_current = 0
   Const add_to_all = 1
   Const as_parent = 0
   Const as_child = 1
   Set objPPRep = CreateObject("CognosPowerPlay.Report")
   objPPRep.New "C:\Cubes and Reports\Great Outdoors.mdc",
-1
   objPPRep.ExplorerMode = False
   objPPRep.Visible = True
   Set objCubeCategories = objPPRep.CategoryList
   objCubeCategories.Add level_1, "Locations" 
   objPPRep.Layers.Add objCubeCategories
   Set objCubeCategories = Nothing
   Set objPPRep = Nothing
End Sub

Related Topics