DistinctCells([WithHidden: Boolean = True]): ITabRange;
DistinctCells[WithHidden: Boolean]: Prognoz.Platform.Interop.Tab.ITabRange;
WithHidden. An optional parameter that indicates whether hidden rows and column should be included into the range. By default the parameter is set to True, hidden rows and columns are included into the range. If the WithHidden parameter is set to False, invisible areas are excluded from the range.
The DistinctCells property returns a composite range, which does not contain overlapping parts.
Sub UserProc(TSheet: ITabSheet);
Var
TRange1, TRange2, TRange3: ITabRange;
Begin
//Get compound range
TRange1 := TSheet.ParseRange("A0:D2;B1:E3;D3:E5");
//Get compound range that consists of independent areas
TRange2 := TRange1.DistinctCells;
//Hide columns
TSheet.Column(2).Hidden := TriState.OnOption;
//Get new compound range that consists of independent areas
//considering hidden areas
TRange3 := TRange1.DistinctCells(False);
End Sub UserProc;
After executing this example three different compound ranges are obtained for the table. TRange1 is obtained by converting the specified address. TRange2 is a compound range that consists of disjoint parts (Range address: A0:D0;A1:E2;B3:E3;D4:E5). TRange3 is a compound range that consists of disjoint parts taking into account hidden areas (Range address: A0:B2;B3;D0;D1:E5).
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Tab;
Sub UserProc(TSheet: ITabSheet);
Var
TRange1, TRange2, TRange3: ITabRange;
Begin
//Get compound range
TRange1 := TSheet.ParseRange("A0:D2;B1:E3;D3:E5");
//Get compound range that consists of independent areas
TRange2 := TRange1.DistinctCells[True];
//Hide columns
TSheet.Column[2].Hidden := TriState.tsOnOption;
//Get new compound range that consists of independent areas
//considering hidden areas
TRange3 := TRange1.DistinctCells[False];
End Sub UserProc;
After executing this example three different compound ranges are obtained for the table. TRange1 is obtained by converting the specified address. TRange2 is a compound range that consists of disjoint parts (Range address: A0:D0;A1:E2;B3:E3;D4:E5). TRange3 is a compound range that consists of disjoint parts taking into account hidden areas (Range address: A0:B2;B3;D0;D1:E5).
See also: