ITabRegions.FindByKey

Syntax

FindByKey(Key: Integer): ITabRegion;

Parameters

Key is the region key.

Description

The FindByKey method searches for the region by the key, which is passed as the Key input parameter.

Example

Sub Main;

Var

MB: IMetabase;

Rep: IPrxReport;

Regs: ITabRegions;

Reg: ITabRegion;

s: String;

i: Integer;

Begin

MB := MetabaseClass.Active;

Rep := MB.ItemById("Reg_rep").Bind As IPrxReport;

Regs := Rep.ActiveSheet.Table.Regions;

Reg := Regs.FindByKey(9);

If Reg <> Null Then

s := Reg.Range.Address;

End If;

End Sub Main;

As a result a region with the key "9" will be searched on the active sheet of the regular report. If the search is successful, he variable "s" will contain the address of the range, in which this region is located.

See also:

ITabRegions