Add (Elements: IDimSelection): IPivotDimElementsDetailingItem;
Elements. Dimension selection.
The Add method adds drill down to the end of the collection.
To remove drill down by index, use the IPivotDimElementsDetailing.Remove method.
To clear the collection of drill downs, use the IPivotDimElementsDetailing.Clear method.
To execute the example, place on the form the Button component named Button1, the EaxDocumentViewerBox component named EaxDocumentViewerBox1, and the UiErAnalyzer component named UiErAnalyzer1. Specify UiErAnalyzer1 as a data source for EaxDocumentViewerBox1. An express report is a data source for UiErAnalyzer1.
Add links to the Dimension, Drawing, Express, ExtCtrls, Forms, Pivot, and Tab system assemblies.
The example is a handler of the OnClick event for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Pivot : IPivot;
Detailing: IPivotDimElementsDetailing;
DetailItem : IPivotDimElementsDetailingItem;
Sel: IDimSelection;
Selset : IdimselectionSet;
Begin
// Get table
Pivot := UiErAnalyzer1.ErAnalyzer.Grid.Pivot;
// Add detailing
Detailing := Pivot.DimElementsDetailing;
// Create a dimension selection
Sel := Pivot.Selection.Item(3).CreateCopy;
Sel.DeselectAll;
Sel.SelectElement(Sel.Dimension.Elements.FindById("10000"), False);
// Add drill down - fix to the left
DetailItem := Detailing.Add(sel);
// Determine a collection of dimension selections
Selset := Pivot.Selection.CreateCopy;
Selset.Item(2).DeselectAll;
Selset.Item(2).SelectElement(Selset.Item(2).Dimension.Elements.FindById("1000"),False);
DetailItem.Selection := Selset;
If detailItem.Elements <> sel Then
Debug.WriteLine("Error");
End If;
End Sub Button1OnClick;
After the button is clicked, the selected dimension element is fixed in express report table.
Original table appearance:
Table appearance after example execution:
See also: