IVZTreeModel.ActiveItem

Fore Syntax

ActiveItem: IVZTreeItem;

Fore.NET Syntax

ActiveItem: Prognoz.Platform.Interop.Visualizators.IVZTreeItem;

Description

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

Fore Example

Executing the example requires that the repository contains an express report with the EXP identifier. The module containing the example should have links to the Express, Metabase and Visualizators system assemblies. The selected 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; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    BubbleTree: IVZBubbleTree; // Bubble tree
    Item: IVZTreeItem; // Tree item
    Model: IVZTreeModel; // Tree model
    ActiveItem: IVZTreeItem;
Begin
    // Get metabase object
    Metabase := MetabaseClass.Active;
    // Open 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

Fore.NET Example

Executing the example requires that the repository contains an express report with the EXP identifier. The selected procedure is the Main entry point in the Program module of the .NET assembly. The Express, Metabase and Visualizators assemblies should be imported to this module from the Prognoz.Platform.Interop system assembly.

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 item active:

Public Shared Sub Main(Params: StartParams);
Var
    Metabase: IMetabase; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    BubbleTree: IVZBubbleTree; // Bubble tree
    Item: IVZTreeItem; // Tree item
    Model: IVZTreeModel; // Tree model
    ActiveItem: IVZTreeItem;
Begin
    // Get metabase object
    Metabase := Params.Metabase;
    // Open express report
    EaxAnalyzer := Metabase.ItemById["EXP_DYN1_COPY57"].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;
    System.Diagnostics.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);
        System.Diagnostics.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;

The result of the executed example is the same as that, executed for Fore language.

See also:

IVZTreeModel