List objects
Inserting list objects
List objects are:
- Combo boxes
- List boxes
- Option buttons
- Hyperblocks
List objects display the elements of the lists to which they are linked.
Hyperblocks are displayed only in Design Mode but the values which they return are displayed in View and Debug.
See modes.
To insert a list object:
- In Design Mode, click the cell, or range of cells, in which to insert the object.
- Click the appropriate button on the Objects toolbar.
Or select
and select an object from the menu.To resize a list object:
- Click the object in Design Mode. A hashed border is displayed.
- Drag the white handles on the border as required.
Referencing objects
List objects are named ListViewN, where N is a sequential number. Command buttons are named ButtonN. Text buttons are named TextN.
Use the name to reference the object in formulas. For example, the
formula
=ListView3.attribute
returns an attribute of the
object.
You can rename objects to make them easier to identify when defining actions, for example. See these topics:
Attributes of list objects
Name | Function | Example |
---|---|---|
=ListView[No].Alias | Displays the caption of a list element. | All Stores |
=ListView[No].Text | Displays the unique name of the list element. | [Store].[All Stores] |
=ListView[No].Attribute | Displays an attribute of the list element. The attribute must first be selected in the Attributes pane of the List Designer. | |
=ListView[No].ElementCount | Returns the number of elements displayed by the ListView object. It increases and decreases as the list is expanded and collapsed. | |
=ListView[No].ElementIndex | Returns the position in the list of whichever element is selected. | |
=ListView[No].Set | Returns the MDX of a list, in Design Mode only. | |
=ListView[No].StructureSet | Returns the MDX of the structure selection of a list, in Design Mode only. |
Examples
ElementCount and ElementIndex
- Switch to Design Mode and link a list to a list object.
- Click an adjacent cell and
specify
=ListViewN.ElementCount
. - In another cell,
specify
=ListViewN.ElementIndex
.
In View Mode, the element count increases and decreases as the list is expanded and collapsed. The element index changes as you select different elements in the list.
Set and StructureSet
This example uses the Best Practices sample database provided with Application Studio.
- Drag the Product dimension from the SALES cube onto the worksheet to create a hyperblock.
- In the List Designer select the All Tires check box in Structure Selection.
- In a worksheet cell,
specify
=[hyperblock_name].Set
.The cell displays the MDX of the list:Distinct({{[PRODUCT].[All Tires]}})
- In another cell, specify
=[hyperblock name].StructureSet
The cell displays the MDX of the structure selection:
{{[PRODUCT].[All Tires]}}