CreateObjectChangeArgs (Report: IReportBox; Sheet: IPrxSheet; Object: ITabObject; Type: TabObjectChangeType);
Report. The component, for which event is generated
Sheet. The report sheet, for which the event is generated
Object. An object, for which an event is generated
Type. Type of change that occurs with an object.
The CreateObjectChangeArgs constructor creates an argument of the event that occurs on changing an object.
By default event arguments are generated automatically on occurring an event. A constructor is required for manual calling the event.
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.
Custom handler for the OnAfterObjectChange event in the ReportBox1 component will be created and called in the example.
Add links to the Report, Tab system assemblies.
// Call the OnAfterObjectChange custom event handler
Sub UserProc;
Var
Report: IReportBox;
Sheet: IPrxSheet;
Shape: IPrxShape;
Object: ITabObject;
Argument: ReportObjectChangeEventArgs;
Begin
Report := ReportBox1.Report.Report As IReportBox;
Sheet := Report.Report.Report.Sheets.Item(0);
Object := Shape As ITabObject;
Argument := New ReportObjectChangeEventArgs.CreateObjectChangeArgs(ReportBox1, Sheet, Object, TabObjectChangeType.Angle);
ReportBox1.OnAfterObjectChange(ReportBox1, Argument);
End Sub UserProc;
// Custom handler of the OnAfterObjectChange event
Sub UserOnAfterObjectChange(Sender: Object; Args: IReportObjectChangeEventArgs);
Begin
Select Case Args.Type
Case TabObjectChangeType.Angle:
Debug.WriteLine("Object '" + Args.Object.Id + "' was rotated");
Case TabObjectChangeType.Rect:
Debug.WriteLine("Object '" + Args.Object.Id + "' was moved or resized");
End Select;
End Sub UserOnAfterObjectChange;
As a result , the UserProc procedure calls the UserOnAfterObjectChange custom event handler.
See also: