IVZTreeModel.ActiveItem

Syntax

ActiveItem: IVZTreeItem;

Description

The ActiveItem property determines active element in the visualizer with hierarchical structure.

Example

Executing the example requires that the repository contains an express report with the EXP identifier. The unit containing the example should have links to the Express, Metabase and Visualizators system assemblies. The specified procedure should be called from the Main entry point.

Before executing the example, a bubble tree looks as shown on the IVZBubbleTree interface description page. Determine identifier of active element in the bubble tree, after that make its parent element active:

Sub UserProc;
Var
    Metabase: IMetabase;
    EaxAnalyzer: IEaxAnalyzer;
    BubbleTree: IVZBubbleTree;
    Item: IVZTreeItem;
    Model: IVZTreeModel;
    ActiveItem: IVZTreeItem;
Begin
    // Get the current repository
    Metabase := MetabaseClass.Active;
    // Get express report
    EaxAnalyzer := Metabase.ItemById("EXP").Edit As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
    // Get tree model
    Model := BubbleTree.Model;
    // Get active element of bubble tree
    ActiveItem := Model.ActiveItem;
    Debug.WriteLine("Active element identifier: " +
        ActiveItem.ID);
    // Get root element
    Item := ActiveItem.Parent;
    If Item <> Null Then
        // Make this element active
        Model.SetActiveItem(Item.ID);
        Debug.WriteLine("Identifier of the new active element: " +
            Model.ActiveItem.ID);
    End If;
    // Save changes made in express report
    (EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the parent element of the current active element becomes active:

The development environment console window displays identifiers of the previous and the new active elements:

Active element identifier: 10001

New active element identifier: 10000

See also:

IVZTreeModel