Report > Report Assembly Interfaces > IPrxControls > IPrxControls.IndexOf
IndexOf(Value: IPrxControl): Integer;
Value. Control.
The IndexOf method returns index of position of a control.
Executing the example requires that the repository contains a regular report with the REPORT identifier. The report contains two sheets. The second sheet contains controls.
Add links to the Metabase, Report system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Rep: IPrxReport;
Ctrls: IPrxReportControls;
Ctrl: IPrxControl;
Sheet: IPrxSheet;
Index: Integer;
Begin
// Get the current repository
MB := MetabaseClass.Active;
// Get regular report
Rep := MB.ItemById("REPORT").Edit As IPrxReport;
// Get sheet
Sheet := Rep.Sheets.Item(1);
// Get sheet controls
Ctrls := Rep.Controls.SheetControls(Sheet);
Ctrl := Ctrls.FindById("ITEM1");
Index := Ctrls.IndexOf(Ctrl);
// Move control
Ctrls.Move(Index, 0);
End Sub UserProc;
After executing the example the control of the second sheet is transferred.
See also: