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.

Note: Command buttons are not list objects but have some similarities. .

Command buttons.

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:

  1. In Design Mode, click the cell, or range of cells, in which to insert the object.
  2. Click the appropriate button on the Objects toolbar.

Or select Insert > Objects and select an object from the menu.

Note: The Objects menu and tool bar include Command Button, Text and Web Extension. Command buttons have some features in common with list objects but are not list objects. Neither are text objects or web extensions list objects. Text objects have a button on the graphics toolbar.

See Inserting Text objects

To resize a list object:

  1. Click the object in Design Mode. A hashed border is displayed.
  2. 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

These attributes of list objects can be displayed on the worksheet:
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

  1. Switch to Design Mode and link a list to a list object.
  2. Click an adjacent cell and specify =ListViewN.ElementCount.
  3. 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.

  1. Drag the Product dimension from the SALES cube onto the worksheet to create a hyperblock.
  2. In the List Designer select the All Tires check box in Structure Selection.
  3. In a worksheet cell, specify =[hyperblock_name].Set.
    The cell displays the MDX of the list:
    Distinct({{[PRODUCT].[All Tires]}})
    	 
  4. In another cell, specify =[hyperblock name].StructureSet

The cell displays the MDX of the structure selection:

{{[PRODUCT].[All Tires]}}