Create (Report: IReportBox; Sheet: IPrxSheet; Object: ITabObject; Type: TabObjectChangeType, Value: Double; Cancel: Boolean);
Create (Report: Prognoz.Platform.Interop.Report.ReportBox; Sheet: Prognoz.Platform.Interop.Report.IPrxSheet; Object: Prognoz.Platform.Interop.Tab.ITabObject; Type: Prognoz.Platform.Interop.Tab.TabObjectChangeType; Value: double; Cancel: boolean);
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
Value. The angle by which an object is rotated
Cancel. Indicates whether object rotation must be canceled.
The Create constructor creates an argument of the event that occurs on object rotation.
By default event arguments are generated automatically on occurring an event. A constructor is required for manual calling the event.
Value of the Value parameter is always positive and is counted clockwise.
Available values of the Cancel parameter:
True. Object rotation is canceled
False. Object rotation is performed.
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 OnBeforeObjectChange event in the ReportBox1 component will be created and called in the example.
Instead of the Fore components use Fore.NET analogs.
For the Fore example, the UserOnAfterObjectChange procedure must be allocated by the OnBeforeObjectChange event handler for the ReportBox1 component.
For the Fore.NET example, the ReportBeforeObjectAngleChangeEventArgs_Create_FormForm_Shown procedure must be set by the Shown event handler for the form.
Add links to the Report, Tab system assemblies.
// Create a custom handler of the OnBeforeObjectChange event
Sub UserOnBeforeObjectChange(Sender: Object; Args: IReportObjectChangeEventArgs);
Begin
If Args.Type = TabObjectChangeType.Angle Then
Debug.WriteLine((Args As ReportBeforeObjectAngleChangeEventArgs).NewValue);
End If;
End Sub UserOnBeforeObjectChange;
// Call the OnBeforeObjectChange custom event handler
Sub UserProc;
Var
Report: IPrxReport;
Sheet: IPrxSheet;
Tab: ITabSheet;
rObject: ITabObject;
Argument: ReportBeforeObjectAngleChangeEventArgs;
Begin
Report := ReportBox1.Report.Report;
Sheet := Report.Sheets.Item(0);
Tab := (Sheet As IPrxTable).TabSheet;
rObject := Tab.Objects.Object("PrxShape1") As ITabObject;
Argument := New ReportBeforeObjectAngleChangeEventArgs.Create(ReportBox1, Sheet, rObject, TabObjectChangeType.Angle, 15, False);
ReportBox1.OnBeforeObjectChange(ReportBox1, Argument);
End Sub UserProc;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
…
// Create a OnBeforeObjectChange custom event handler
Sub UserOnBeforeObjectChange(Sender: Object; Args: IReportObjectChangeEventArgs);
Begin
If Args.Type = TabObjectChangeType.toctAngle Then
System.Diagnostics.Debug.WriteLine((Args As ReportBeforeObjectAngleChangeEventArgs).NewValue);
End If;
End Sub UserOnBeforeObjectChange;
// Determine the UserOnBeforeObjectChange custom handler to the OnBeforeObjectChange event
Private Sub ReportBeforeObjectAngleChangeEventArgs_Create_FormForm_Shown(sender: System.Object; e: System.EventArgs);
Begin
ReportBoxNet1.OnBeforeObjectChange += New Prognoz.Platform.Forms.Net.ReportBoxNet.OnBeforeObjectChangeEventHandler(UserOnBeforeObjectChange);
End Sub;
// Call custom handler of the OnBeforeObjectChange event
Sub UserProc();
Var
Report: IPrxReport;
Sheet: IPrxSheet;
Tab: ITabSheet;
rObject: ITabObject;
Argument: ReportBeforeObjectAngleChangeEventArgsClass = New ReportBeforeObjectAngleChangeEventArgsClass.Create();
Begin
Report := ReportBoxNet1.Source.Report;
Sheet := Report.Sheets.Item[0];
Tab := (Sheet As IPrxTable).TabSheet;
rObject := Tab.Objects.Object["PrxShape1"] As ITabObject;
Argument.Create(ReportBoxNet1.CtrlBox As ReportBox, Sheet, rObject, TabObjectChangeType.toctAngle, 15, False);
UserOnBeforeObjectChange(ReportBoxNet1, Argument);
End Sub UserProc;
As a result , the UserProc procedure calls the UserOnAfterObjectChange custom event handler.
See also: