KeepOnlyElements(Range: ITabRange; [SlotIndex: Integer = -1]);
KeepOnlyElements(Range: Prognoz.Platform.Interop.Tab.ITabRange; SlotIndex: integer);
Range. Table cells range
SlotIndex. Slot index in the header.
NOTE. The SlotIndex parameters determines in which dimension entering in the header, selection must be changed. If SlotIndex = -1, selection will be changed in the first dimension.
The KeepOnlyElements method changes selection in such a way that only the specified cell range is available in the table.
As a value of the Range parameter, the range of headers cells, located in the rows or columns, is required to be determined.
The method leaves available elements of the dimension, the index of which is passed to SlotIndex.
Executing the example requires a form containing the Button component named Button1, the TabSheetBox component named TabSheetBox1 and the UiErAnalyzer component named UiErAnalyzer1. Set UiErAnalyzer1 as a data source for the TabSheetBox1 component.
Set express report as a data source for the UiErAnalyzer1 component. Set for the UiErAnalyzer1 component the Active property = True.
The procedure is a handler of the OnClick event for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Eax: IEaxAnalyzer;
Grid: IEaxGrid;
TR: ITabRange;
Begin
Eax := UiErAnalyzer1.ErAnalyzer;
Grid := Eax.Grid;
TR := Grid.TabSheet.ParseRange("C1:D2");
Grid.KeepOnlyElements(TR);
End Sub Button1OnClick;
After executing the example only the cells of the specified range are in the table.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Tab;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Eax: IEaxAnalyzer;
Grid: IEaxGrid;
TR: ITabRange;
Begin
Eax := UiErAnalyzerNet1.AnalyzerUi.ErAnalyzer;
Grid := Eax.Grid;
TR := Grid.TabSheet.ParseRange("C1:D2");
Grid.KeepOnlyElements(TR, -1);
End Sub;
See also: