ActiveItem: IVZTreeItem;
The ActiveItem property determines active element in the visualizer with hierarchical structure.
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 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; // 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
See also: