Since version 12.4 the XFRXListener class (which is used when running reports in VFP 9.0 in the object assisted (report listener) mode) is derived from the UtilityReportListener class, which is not included inside XFRX.PRG (XFRX.FXP) and needs to be provided for XFRX to run correctly. UtilityReportListener is a FFC class, which takes care, via its predecessor FXListener, of the new dynamic reporting features introduced in VFP 9.0 SP2. It is implemented in ReportListener.vcx class library, which is by default stored in the FFC subdirectory of the VFP home directory. In the development environment you make it available by executing the following command:
SET CLASSLIB TO (HOME()+"ffc\_reportlistener")
To distribute UtilityReportListener with your application you need to include the following FFC files (all available in the FFC directory):
A drawback of including the FFC classes to your project is that they add almost 1MB to the final exe size so alternatively, if you don't use the dynamic features in SP2 and you would like to reduce the final exe size, you can use a UtilityReportListener implementation that comes in with the XFRX package in UtilityReportListener.zip. This implementation corresponds to the pre-SP2 FFC class and is only about 30KB. To use the alternative implementation add the following files to your project (all available in the UtilityReportListener.zip archive):
and make the implementation visible by executing the following command before running XFRX:
SET PROCEDURE TO utilityReportListener.prg ADDITIVE
How XFRX handles different version of Visual FoxPro
XFRX for VFP 8 contains its own report engine that mimics the behavior of the native Visual FoxPro report engine.
XFRX for VFP 9 is implemented as an XFRXListener class, a descendant of UtilityReportListener class (please see _REPORTLISTENER.VCX in FFC for more information about the basic report listener classes provided by FFC). The XFRXListener class complies with the object-assisted reporting standards introduced in VFP 9 and perfectly fits into the new open architecture. You can use it alone or in combination with other report listeners provided with the product or by third parties.
About 95% of XFRX is written in Visual FoxPro and, to make the deployment as easy as possible, all its source code (without the visual classes for the report previewer container) is in one PRG file, both for VFP 8.0 and VFP 9.0: XFRX.PRG. This PRG file is the same for all VFP versions.
If you purchase XFRX without source codes, you will be able to download XFRX.FXP compiled in the VFP version you are using.
If you purchase the source code, before you add XFRX.PRG into your project and compile it, you need to enable (uncomment) one of the #DEFINE commands at the beginning of XFRX.H, which determines the VFP version you are using.
Example: If XFRX is used in VFP 8.0, the beginning of XFRX.H would look like this:
*#DEFINE VFP5 *#DEFINE VFP6 *#DEFINE VFP7 #DEFINE VFP8 *#DEFINE VFP9
Differences between XFRX for VFP 8.0 and XFRX for VFP 9.0
As written in the previous paragraph, XFRX for VFP 9.0 uses the native report engine, which results in the following advantages:
- The layout of the documents produced by XFRX for VFP 9.0 should generally be more exact as the same engine is used both for printing and for document generation.
- XFRX for VFP 9.0 is approximately twice as fast as XFRX for VFP 8.0.
- Variables declared as LOCAL are not visible in XFRX for VFP 8.0.
- XFRX for VFP 8.0 has some restrictions in handling the data environment. It is able to set up the data environment, open tables, setup relations and fire the data environment methods, but the data environment instance itself is not available. This restriction does not apply to VFP 9.0.
- XFRX for VFP 9.0 is able to display any content of general fields, including ActiveX components. XFRX for VFP 8.0 is able to extract just BMP and JPEG pictures from the general fields.
- XFRX for VFP 8.0 does not support multicolumn layout where records are laid from left to right (rather than from top to bottom). This limitation does not apply for VFP 9.0.
Distributing XFRX with other applications
The best way to distribute XFRX is to include XFRX.FXP (or XFRX.PRG, if you purchased the source code option) into the target application’s exe (add it to your project, to the section where your PRGs are). This way, you won’t have to distribute this file and, more importantly, XFRX will be able to access the reports and other resource files (pictures, tables, etc.) built into the exe as well.
If you are using the XFRX previewer, add the appropriate files from the XFRXLIB directory to your project as well.
The support libraries (XFRXLIB.FLL, HNDLIB.DLL, MD5.FLL and ZLIB.DLL) cannot be included in the exe and need to be distributed along with the application. They need to be located either in the same directory where the main EXE is or in a directory defined in SET PATH command.
Dependencies of XFRXLIB.FLL
XFRXLIB.FLL requires three other DLL libraries from Microsoft to be installed on the target computers: gdiplus.dll, msvcr71.dll and msvcp71.dll.
If you try to use XFRX with XFRXLIB.FLL without these DLLs installed, SetParams() method will return -6, “xfrxlib.fll cannot be loaded (it is missing or invalid)”.
All of these dll libraries can be downloaded from Eqeus or Microsoft website:
- msvcr71.dll - Microsoft Visual C++ 7.1 runtime library. If it is not installed on your pc, you can download it from http://www.eqeus.com/files/msvcr71.zip
- msvcp71.dll – Microsoft Visual C++ 7.1 runtime library. You can download it from: http://www.eqeus.com/files/msvcp71.zip
- gdiplus.dll - This DLL is included with Windows XP and if it is not available on your pc, you can download it from http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdkredist.htm