External Function Libraries
<< Click to Display Table of Contents >> External Function Libraries |
![]() ![]() ![]() |
External Function Libraries (EFLs) can be used to expand the functionality available to ReportPro's Expression Builder. EFLs work with the ReportPro runtime libraries as well as the stand-alone designer. Function prototypes can also be displayed in the Functions list box of the Expression Builder.
The function libraries must reside in a DLL created with CA-Visual Objects 2 and follow certain guidelines explained below. This feature is only available for the 32-bit version of ReportPro.
Creating Function Library DLLs
To create an EFL, use CA-VO 2 to create a DLL that contains the functions you wish to call from ReportPro. The functions must be macro-compilable; they must be un-typed and follow the Clipper calling convention. Other functions in the EFL that are not called directly by ReportPro can be typed if desired.
Example
function ThisFunctionWillWork
return "Hello, World!"
function ThisWillWorkAlso
return ctod("5/4/96")
function ThisFunctionWillNotWork as string
return "Because it is strong typed"
function ThisWillNotWorkEither (cString as string)
return "Since cString is strong typed"
Registering your Functions with the Expression Builder
When ReportPro loads an EFL, it calls the function rpFunctionList() if it exists in the EFL DLL. ReportPro expects that this function will return a one-dimensional array containing the function prototypes to include in the Expression Builder function list. All of the functions available in the EFL need not be listed in the array, only those you wish to be displayed in the Expression Builder.
Example
function rpFunctionList as array
local aArray as array
aArray :={}
aadd(aArray, "MyFunction(n)")
aadd(aArray, "MyOtherFunction(c)")
return aArray
Installing an EFL in ReportPro
EFLs must be identified in the RPWIN.INI file. The Function Library section of the INI file must contain the file name of each EFL you wish to integrate into ReportPro. This of course, means that you must distribute the RPWIN.INI file with your application if you use an EFL.
Example
[FunctionLibs]
LIB1=MyLib.DLL
LIB2=MyOther.DLL
External Function Library Registration Program
The ReportPro External Function Library Registration Program was created to aid the developer in creating EFLs that work with ReportPro. You can register your EFL with DataPro to ensure that the names of EFLs are unique and will not conflict with other EFLs from other developers.
DataPro strongly recommends that all developers participate in the ReportPro External Function Library Registration Program. Contact DataPro for more information and a registration application.