Condividi tramite


ReportListener FXListener Foundation Class

FXListener enables you to change the display characteristics of report controls during a report run. You can use two member collections: FXs (adjust content and format instructions) and GFXs (adjust or replace GDIPlus-graphics rendering) to affect report rendering.

Category Reporting

Default Catalog

Visual FoxPro Catalog\Foundation Classes\Output\Report Listeners

Class

FXListener

Base Class

ReportListener

Class Library

_REPORTLISTENER.vcx

Parent Class

_ReportListener (ReportListener Base Foundation Class)

Remarks

You will probably not instantiate this class directly. You will instantiate one of the classes that derive from it, such as HtmlListener.

To take advantage of FXListener's ability to effect report output, you need to create FX or GFX objects.

Note

The fxAbstract class in the _REPORTLISTENER.vcx class library supplies an abstract instance of the required interface for an FX or GFX object.

Each FX or GFX object must provide the following interface:

PROCEDURE ApplyFX(toListener, tcMethodToken,tP1, tP2, tP3, tP4, tP5, tP6, tP7, tP8, tP9, tP10, tP11, tP12).
  • toListener
    A reference to the listener object.
  • tcMethodToken
    The report listener event currently executing: AdjustObjectSize, AfterBand, AfterReport, BeforeBand, BeforeReport, Destroy, Error, EvaluateContents, Init, LoadReport, or UnloadReport
  • tP1 through tP12
    The parameters of the report listener event currently executing. For example, the BeforeBand event has two parameters, nBandObjCode and nFRXRecNo. When tcMethodToken is "BeforeBand," tP1 is nBandObjCode and tP2 is nFRXRecNo.

You can use FXListener's AddCollectionMember method to add FX or GFX objects to your report listener. For example, the following code in the Init event of an htmllistener adds an FX object to the collection.

THIS.AddCollectionMember("myFX", "myClassLibrary.vcx")
DODEFAULT( )

For each report listener event, FXListener invokes its sendFX( ) method to call the ApplyFX( ) method in every FX or GFX object in the collections. You can use IF...ENDIF blocks or CASE statements to check for the report listener event and then take appropriate action. For example, the following section of code in the ApplyFX method of an FX object makes the text of a control on a report upper case.

LPARAMETERS toListener, tcMethodToken,tP1, tP2, tP3, tP4, tP5, tP6, tP7, tP8, tP9, tP10, tP11, tP12
IF tcMethodToken == "RENDER"
  IF tP1 == 11 
  * nFRXRecno is Render's 1st param (tP1) and 11 refers to 
  * the record in the FRX of a particular control on the report
  tP7 = UPPER(tP7)
  * cContentsToBeRendered is Render's 7th param
  ENDIF
ENDIF

Note

The subclasses of fxAbstract (fxmemberdatascript, fxresetpagetotal, gfxexample, gfxnorender, and gfxrotate) provide examples of FX and GFX classes you can use with FXListener.

The following table lists public properties and methods added by this class to its parent class, _ReportListener.

Properties and methods Description

AddCollectionMember Method

Adds an instance of a specified class in a specified class library to the FX or GFX collection. This method expects the following parameters: tcClass, tcClassLib, tcModule, tlSingleton, tlInGFX, tlRequired.

CancelRequested Property

Notification flag for FX objects used to request a report cancellation.

CheckCollectionForSpecifiedMember Method

Checks the FX or GFX collection for an instance of a class by class name and (if specified) by class library name. Returns the logical (.F. if not found) or object reference.

ClassPath Property

Optional location that specifies the path for loading objects from external libraries.

FFCGraphics Property

Reference to an FFCGraphic object created during the run. It is provided to members of the GFXs collection. It is validated as an instance of GpGraphics from the FoxPro Foundation Class (FFC) _GDIPLUS.VCX or a class derived from GpGraphics.

FRXCursor Property

Holds a reference to an FRXCursor helper object. It is used to facilitate run-time calculations related to FRX metadata, structure, and memberdata.

FXFeedBackClass Property

Class to instantiate in the FX collection for user feedback (defaults to fxTherm).

FXFeedbackClassLib Property

Class library from which to instantiate the FX collection object that provides user feedback.

FXFeedbackModule Property

Application module (APP or EXE) from which to instantiate the FX collection object that provides user feedback.

FXMemberDataScriptClass Property

Class to instantiate in FX collection for memberdata-based script handling (defaults to fxMemberDataScript).

FXMemberDataScriptClassLib Property

Class library from which to instantiate the FX collection object that provides memberdata-based script-handling.

FXMemberDataScriptModule Property

Application module (APP or EXE) from which to instantiate the FX collection object that provides memberdata-based script-handling.

FXs Property

Collection of FX objects. Each object must have the following interface:

PROCEDURE ApplyFX(toListener, tcMethodToken,tP1, tP2, tP3, tP4, tP5, tP6, tP7, tP8, tP9, tP10, tP11, tP12).

The return value from this procedure is ignored.

getFRXRecno Method

Determines the current FRX cursor row number from the parameters that is passed to a ReportListener event.

getPathForExternals Method

Determines the location at which the current configuration table and any other required external files will be expected.

GFXNoRenderClass Property

Class to instantiate in the GFX collection for conditionally eliminating baseclass rendering of the various layout controls. It defaults to gfxNoRender if the empty conditional rendering is turned off.

GFXNoRenderClassLib Property

Class library from which to instantiate the GFX collection object that provides conditional baseclass rendering.

GFXNoRenderModule Property

Application module (APP or EXE) from which to instantiate the GFX collection object that provides conditional baseclass rendering.

GFXRotateClass Property

Class to instantiate in the GFX collection for rotating layout controls. It defaults to gfxRotate.

GFXRotateClassLib Property

Class library from which to instantiate the GFX collection object that provides rotation.

GFXRotateModule Property

Application module (APP or EXE) from which to instantiate the GFX collection object that provides rotation.

GFXs Property

A collection of GFX objects. Each object must have the following interface:

PROCEDURE ApplyFX(toListener, tcMethodToken,P1, tP2, tP3, tP4, tP5, tP6, tP7, tP8, tP9, tP10, tP11, tP12)

The Render method relies on the return value of the procedure.

loadFrxCursor Property

Determines whether this class should dynamically load an instance of the helper class FRXCursor when you try to access a reference to it.

MemberDataAlias Property

Alias of the cursor that holds memberdata in the FRXDataSession. It is read from the FRX table's Style field for easy access by other objects.

removeCollectionMember Method

Provides a way to remove an FX or a GFX object from the FXListener's collections by using an object instance name or a class name.

reportStartRunDatetime Property

A datetime value that indicates when the last report-generation run began. This property contains meaningful data if the feedback member object has been instantiated. It provides a property with a matching name. This property is read-only.

reportStopRunDatetime Property

A datetime value for when the last report-generation run ended. This property contains meaningful data if the feedback member object has been instantiated. It provides a property with a matching name. This property is read-only.

RunCollectorResetLevel Property

Indicates how often the runCollector member should be automatically reset by the report listener (0=never, 1=after each report, 2=after a chained report run).

See Also

Reference

ReportListener Base Foundation Class

Concepts

Using GDI+ in Reports