rptRegisterProvider
Three real extensibility mechanisms: register a custom
BOOL32 __stdcall rptRegisterProviderA(TRPT Engine, const char* Name, PRptProviderVTable VTable, void* UserData);
BOOL32 __stdcall rptRegisterFunctionA(TRPT Engine, const char* Name, int32_t MinArgs, int32_t MaxArgs, void* Fn, void* UserData);
BOOL32 __stdcall rptLoadPluginA(TRPT Engine, const char* Path);
function rptRegisterProviderA(const Engine: TRPT; const Name: PAnsiChar; VTable: PRptProviderVTable; UserData: Pointer): LongBool; stdcall;
function rptRegisterFunctionA(const Engine: TRPT; const Name: PAnsiChar; MinArgs, MaxArgs: Integer; Fn: Pointer; UserData: Pointer): LongBool; stdcall;
function rptLoadPluginA(const Engine: TRPT; const Path: PAnsiChar): LongBool; stdcall;
Purpose. Three real extensibility mechanisms: register a custom data provider (a C-callback vtable exposing arbitrary tabular data to the report's data-binding layer, V16 conceptual chapter 05), register a custom expression-language function callable from {{ }}/expressions (chapter 04), and load an ABI-1 plugin DLL (chapter 07).
Description. rptRegisterProvider wraps the caller's VTable+ UserData in a real TRptCallbackProvider and registers it on the engine's provider registry — no W variant exists at all, only the bare/A form (per the unit's header comment, the bare export name aliases the A variant at the .dpr export-table level — this function's Name is therefore always the UTF-8-as-char* convention, with no true wide-string entry point). rptRegisterFunction similarly has no W variant — registers a C function pointer (Fn, cast to TRptCUserFn) with an arity range (MinArgs/MaxArgs) into the expression engine via RptEngineRegisterCFunction. rptLoadPlugin is real but license-feature-gated independently of the base engine license: even a successfully-created, otherwise-valid engine will reject rptLoadPlugin with a specific RPT_E_LIC_FEATURE error if the license's feature bits don't include RPT_FEAT_PLUGINS — a genuine tiered-licensing check separate from the base rptCreateEngine validation, checked fresh on every load-plugin call.
Parameters.
| Parameter | Description |
|---|---|
Engine | Target engine handle. |
Name | *(Provider/Function)* Registration name (UTF-8-as-char* convention); Provider/Function have no W variant at all. |
VTable, UserData | *(Provider only)* The caller's data-provider callback table and opaque context. |
MinArgs, MaxArgs, Fn, UserData | *(Function only)* Arity bounds and the C callback + context. |
Path | *(LoadPlugin only)* Path to the plugin DLL. |
Return value. True on success. rptLoadPlugin specifically fails with a recorded RPT_E_LIC_FEATURE error (retrievable via rptGetLastError) if the license lacks the plugin feature, distinct from a generic failure.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Reporting
rptRegisterProvider
rptRegisterProviderA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.