ISharedEventHandler.Object

Syntax

Object: IMetabaseObjectDescriptor;

Description

The Object property determines object which will be used to process events.

Comments

Event handlers  can be the following Fore objects only:

The property is relevant, if the ISharedEventHandler.Enabled property is set to True.

Example

Executing the example requires that the repository contains a unit with the EXPRESS_EVENTS identifier, which will be a handler of the express report events. The unit contains the EventsClass specific class, which description is given on the Event Handling page.

Add links to the Fore, Metabase system assemblies.

Sub UserPRoc;
Var
    MB: IMetabase;
    SParams: ISharedParams;
    ShPar: IMetabaseObjectDescriptor;
    EventHandlers: ISharedEventHandlers;
    EventHandler: ISharedEventHandler;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get global variables area
    ShPar := MB.SpecialObject(MetabaseSpecialObject.SharedParams);
    // Get repository parameters
    SParams := Shpar.Edit As ISharedParams;
    // Get object to work with reports event handler
    EventHandlers := SParams.EventHandlers;
    // Use reports event handler
    EventHandlers.Enabled := True;
    // Get and activate express reports event handler
    EventHandler := EventHandlers.EventHandler(SharedEventHandlerType.ExpressReport);
    EventHandler.Enabled := True;
    // Connect unit to handle events
    EventHandler.Object := MB.ItemById("EXPRESS_EVENTS");
    // Set unit class
    EventHandler.EventsClass := "EVENTSCLASS";
    // Save changes
    (SParams As ImetabaseObject).Save;
End Sub UserPRoc;

After executing the example, the event handler is set for express reports.

See also:

ISharedEventHandler