Building a custom report functions library

Custom report functions can be built in any programming language that allows creation of the appropriate file type - dynamic load libraries on Windows operating systems, shareable libraries on UNIX operating system, or shared object files on the Linux® operating system.

The report function declaration must follow a specific format, as defined in the crxSDK.h file. In compiling your .dll files, this header file is always included via an include statement.

Example of a report function prototype

Report functions may have any number of arguments, ranging from none to 15. The report function prototype, consisting of its name and arguments, is defined as follows in the crxSDK.h file.

typedef CCLDBColumnState (*PF_CallFunction)
(
void* result,
uint resultsize,
const crxDataI* context,
void* arg1,
void* arg2,
void* arg3,
void* arg4,
void* arg5,
void* arg6,
void* arg7,
void* arg8,
void* arg9,
void* arg10,
void* arg11,
void* arg12,
void* arg13,
void* arg14,
void* arg15,
void* arg16
);

where:

  • The first argument receives the result of the function execution.
  • The second argument, resultsize, sets the size of the results buffer in bytes. The buffer is pre-allocated by the expression engine.
  • The third argument is the context, and is ignored.
  • All other arguments are the function input arguments as specified in the function definition file. Function definition file.