Exported functions

In order for Crystal Enterprise to properly load, initialize, and terminate your extension, you must export the following three functions using standard C calling conventions. They are called by Crystal Enterprise in this order:

Note:    If the programming language you are using is C++, then these functions must be defined in your .cpp file with your own code inside them. They should also be exported using a .def file, or something similar, if you are working on a UNIX platform. For an example, see simpleclient.def (Windows) or simpleclient.def.unix (UNIX). These files are located on the Crystal Enterprise CD in the following directory: <drive>:\samples\processext\simpleclient.

Typical calling behavior

The IInitializePlugin function (which initializes the plugin) and ITerminatePlugin function (which releases the plug-in) are called once per request, whereas the IProcessRequest (which accesses and modifies the report) may be called several times, depending on the number of subreports that are being viewed or processed. For example, if a user views a report that uses a processing extension, and then drills down on two subreports, subreport1 and subreport2, then the sequence of calls might look like this:

Tip:    Many different requests may be sent to a processing extension concurrently, which means that the DLL or shared library must support multi-threading; that is, it must be thread-safe and re-entrant. Because a processing extension may need to handle more than one request, you will not know how long it will remain in memory.

Calling flow diagram

The processing extension is loaded on a per request basis. The following diagram illustrates how the processing extension is called for a schedule request that is being processed on the Job Server:

The calling behavior is similar for view requests that are processed on the Page Server. IProcessRequest is event-based, and is called when the user views the report or drills down on a subreport.



Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com