C++ Interface

To use ApplyIt! Reporting Engine in your C++ Application you need to include class cReport into your application and write your application using cReport objects.

You also have access to DLL wrapper-class cReportsDLL.

Classes and functions are listed below with specification and usage hints.

Functions marked with BLACK are implemented in present version.

Functions marked with GRAY are planned for future releases.


cReportsDLL Class Specification

cReportsDLL class is a wrapper-class encapsulating boring DLL engagement routines.

There is a global object ReportsDLL available for your needs to control Reporting Engine.


long GetMajorVersion(void)

Function returns a major version number (X of X.Y version number).

You can use this function to check compatibility of your application with ApplyIt! Reporting Engine.


long GetMinorVersion(void)

Function returns a minor version number (Y of X.Y version number).

You can use this function to check compatibility of your application with ApplyIt! Reporting Engine.


char*  GetRegisteredUser(void)

Function returns name of the registered user of Reporting Engine, or returns "UNREGISTERED" in free version.

When you will become a Registered User, you will receive a Registration Key. This registration key should be stored in string resources of your application and Reporting Engine will read it right when you will attach to the DLL.


BOOL AttachToDLL(void)

Function loads DLL, attaches to it and returns TRUE if attached, FALSE in any other case.

AttachToDLL is called every time you call cReport functions to ensure that library is loaded. This function provides you explicit control to load Library.


BOOL DetachFromDLL(void)

Function unloads DLL and returns TRUE if unloaded and FALSE in any other case.

DetachFromDLL is called automatically, when application is terminated (on destruction of ReportsDLL object). This function provides you explicit control to unload Library.


cReport Class Specification

cReport class is a wrapper-class to DLL functions, allowing you to manage your report.

All functions return TRUE if function is successfully executed and FALSE in any other case. This class also displays error messages, when they occur.


Report Generation Functions


BOOL LoadReport(const char* ReportFile, FFetchRow fFetchRow=NULL, FGetFieldValue fGetFieldValue=NULL)

Function loads report definition file specified in ReportFile.

Function provides you explicit control to retrieve data for report, by specifying two callback functions:
- to fetch new row
- to get value of specified field.

You must call this function prior to generating a report. If by any reason you want to retrieve data manually - define callback functions mentioned above and pass them as parameters to LoadReport function, otherwise don't specify them.


BOOL GenerateReport(void)

Function retrieves data and generates image of the report.

You must call this function prior to using a report presentation functions. If you have specified callback functions to retrieve data, these will be called from this function.


BOOL LoadLabels(const char* LabelsFile)

Function loads labels from the external file specified in LabelsFile.

You must call this function after you have loaded a report and before generation of the report. Otherwise, labels will not appear in the report. 


BOOL ImportReportImage(const char* ImportFile)

Imports previously exported report image from the ImportFile.

Because report image file ImportFile contains all data (both report definition and report image), so this function does not require other report generation functions before to present the report.


Report Presentation Functions

Report presentation functions must be called after report is generated.


BOOL PrintReport(void)

Function prints Report according to Report Definition.


BOOL PreviewReport(void)

Function opens a window and previews report.
Function is available in beta-version.


BOOL ExportReportImage(const char* ExportFile)

Exports generated report image into the ExportFile.

Export writes all information from report (both definition and generated image) to the external file ExportFile, so you can later import a file and view report again.