ITabRange.Combine

Fore Syntax

Combine(Range: ITabRange; CombineMode: TabRangeCombineMode): ITabRange;

Fore.NET Syntax

Combine(Range: Prognoz.Platform.Interop.Tab.ITabRange; CombineMode: Prognoz.Platform.Interop.Tab.TabRangeCombineMode): Prognoz.Platform.Interop.Tab.ITabRange;

Parameters

Range. Current range of table elements.

CombineMode. Method that is used to change the current range.

Description

The Combine method changes the current range.

Comments

Depending on the value of the CombineMode parameter, the method creates or complements the current composite range, selected as an input parameter.

Fore Example

Executing the example requires a form containing the Button component named Button1, the UiErAnalyzer component named UiErAnalyzer1 and the TabSheetBox component named TabSheetBox1. Set UiErAnalyzer1 as a data source for TabSheetBox1. An express report containing a table with data should be specified as the source for UiErAnalyzer1.

The procedure is the OnClick event handler for the Button1 button.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Eax: IEaxAnalyzer;
    Grid: IEaxGrid;
    TR1: ITabRange;
    TR2: ITabRange;
Begin
    Eax := UiErAnalyzer1.ErAnalyzer;
    Grid := Eax.Grid;
    TR1 := Grid.TabSheet.ParseRange("B2:C2");
    TR2 := Grid.TabSheet.ParseRange("C2:D2");
    TR2 := TR2.Combine(TR1, TabRangeCombineMode.Xor_);
    Grid.KeepOnlyElements(TR2);
End Sub Button1OnClick;

Clicking the button leaves in the table the range obtained after aggregation of initial ranges excluding their crossing.

Fore.NET Example

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;
    TR1: ITabRange;
    TR2: ITabRange;
Begin
    Eax := UiErAnalyzerNet1.ErAnalyzer.ErAnalyzer;
    Grid := Eax.Grid;
    TR1 := Grid.TabSheet.ParseRange("B2:C2");
    TR2 := Grid.TabSheet.ParseRange("C2:D2");
    TR2 := TR2.Combine(TR1, TabRangeCombineMode.trcmXor);
    Grid.KeepOnlyElements(TR2, -1);
End Sub;

See also:

ITabRange

Related work items

Requirement