- 48 -
17 Drawing custom objects with XFRX#DRAW
The XFRX#DRAW class described in the previous chapter is also able to modify the
content of XFF files: to add custom graphics, text, new pages, hyperlinks and
bookmarks, both during the report generation process as well as after the report is
17.1 Drawing custom objects to existing XFF files
To add custom graphics objects to XFF files, instantiate the XFRX#DRAW object as
described in previous chapter and use the properties and methods described in chapter
17.3 XFRX#DRAW functions
below. All changes are immediately written to the XFF file
and once the XFRX#DRAW class reference is released, the changes are written to the
disk (or other media the XFF file is stored on).
17.2 Drawing custom objects during report generation process
Alternatively, you can create scripts, which can be invoked on the fly, during the report
generation process. These scripts can either be implemented as methods of a class, or,
for rectangle-bound scripts, can be entered into a comment field of a rectangle object on
Note: In XFRX for VFP 9.0, the XFF file is always internally used when a report is
processed. However, in XFRX for VFP 8.0, you can generate the target documents
“directly”, in which case, however, the XFF scripts would not be evaluated.
The page-bound scripts are implemented as methods of an arbitrary class – you can use
a custom class that is instantiated before XFRX is executed, implement the scripts as
methods of the current form or whatever else is convenient in your application
environment. Each script method accepts one parameter: the XFRX#DRAW object
reference. This reference links to the document that is being generated.
DEFINE CLASS myXFRXScripts as Custom
Before XFRX is called, the scripts are registered with RegisterScript() in the XFRX
session class instance so that XFRX new about these scripts and invoked them as
required. You can execute the scripts on each page, odd or even pages or arbitrary pages.
Please see Methods common in XFRXListener and XFRXSession classes
detail description of this method and its parameters.