AlignSelected(Alignment: TabObjectsAlignment);
AlignSelected(Alignment: Prognoz.Platform.Interop.TabSheet.TabObjectsAlignment, RelativeToView: boolean);
Alignment. The parameter, defining the method of aligning of several objects.
The AlignSelected method aligns groups of objects relative to visible sheet area.
To adjust the size of selected objects, use the ITabObjects.AdjustSelected method.
To execute the example a regular report with the Regl_Rep identifier is required.
Add links to the Metabase, Report and Tab system assemblies.
Sub UserProc;
Var
mb: IMetabase;
Rep: IPrxReport;
Sheet: IPrxTable;
TObj: ITabObjects;
i: Integer;
Begin
mb := MetabaseClass.Active;
Rep := MB.ItemById("Regl_Rep").Edit As IPrxReport;
Sheet := Rep.Sheets.Item(0) As IPrxTable;
TObj := Sheet.TabSheet.Objects;
For i := 0 To TObj.Count - 1 Do
TObj.Item(i).Select_;
End For;
TObj.AlignSelected(TabObjectsAlignment.Left);
(Rep As IMetabaseObject).Save;
End Sub UserProc;
After executing the example all objects on the set regular report sheet are selected. Next the objects are aligned to the left edge with respect to the leftmost object.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
Rep: IPrxReport;
Sheet: IPrxTable;
TObj: ITabObjects;
TabObjAl: TabObjectsAlignment;
i: Integer;
Begin
mb := Params.Metabase;
Rep := MB.ItemById["Regl_Rep"].Edit() As IPrxReport;
Sheet := Rep.Sheets.Item[0] As IPrxTable;
TObj := Sheet.TabSheet.Objects;
For i := 0 To TObj.Count - 1 Do
TObj.Item[i].@Select();
End For;
TabObjAl := TabObjectsAlignment.toaLeft;
TObj.AlignSelected(TabObjAl, True);
(Rep As IMetabaseObject).Save();
End Sub;
See also:
Related work items
Requirement