Create(Report: IReportBox; Sheet: IPrxSheet; Object: ITabObject; Rect: IGxRectF; [Cancel: Boolean]);
Report. Component, for which the event is generated.
Sheet. Report page, for which event is generated.
Object. Object, for which event is generated.
Rect. Coordinates of the rectangular area used by the object.
Cancel. It determines whether object moving is canceled.
The Create constructor creates an argument of the event that occurs when object is moved.
Executing the example requires a form containing the ReportBox component named ReportBox1 and the UiReport component named UiReport1, which is a data source for ReportBox1. Set the Active property of the UiReport1 component to True. UiReport1 must contain loaded regular report with shapes on active sheet.
A custom handler for the OnObjectMoving event in the ReportBox1 component is created and called in the example.
Add links to the Drawing, Report, Tab, Ui system assemblies.
// Create the OnObjectMoving custom event handler
Sub UserOnObjectMoving(Sender: Object; Args: IReportObjectMovingEventArgs);
Begin
Args.Cancel := Not WinApplication.ConfirmationBox("Move object: " + Args.Object.Id);
End Sub UserOnObjectMoving;
// Call the OnObjectMoving custom event handler
Public Sub UserProc;
Var
Report: IPrxReport;
Sheet: IPrxSheet;
Tab: ITabSheet;
rObject: ITabObject;
Rect: IGxRectF;
Argument: IReportObjectMovingEventArgs;
Begin
Report := ReportBox1.Report.Report;
Sheet := Report.Sheets.Item(0);
Tab := (Sheet As IPrxTable).TabSheet;
rObject := Tab.Objects.Object("PrxShape1") As ITabObject;
Argument := New ReportObjectMovingEventArgs.Create(ReportBox1, Sheet, rObject, Rect, False);
UserOnObjectMoving(ReportBox1, Argument);
End Sub UserProc;
After executing the example the UserProc procedure calls the UserOnObjectMoving custom handler.
See also: