API referenceReporting

rptRegisterExporter

Register a custom export target with a reporting engine,

C
BOOL32 __stdcall rptRegisterExporter(TRPT Engine, SI32 TargetId, void* Fn, void* UserData);
Delphi
function rptRegisterExporter(const Engine: TRPT; TargetId: Integer; Fn: Pointer; UserData: Pointer): LongBool; stdcall;

Purpose. Register a custom export target with a reporting engine, so rptExport can write formats beyond the built-in ones through a host-supplied callback.

Description. Binds TargetId to the host's export thunk Fn (called with UserData when a job is exported to that target). Custom ids live at or above RPT_EXP_CUSTOM_BASE — ids below it are reserved for the built-in exporters and are refused. Registering an id again replaces the previous callback. The engine must hold a verified runtime licence, the same precondition every rpt* registration call shares.

Parameters.

ParameterDescription
EngineReporting engine handle (rptCreateEngine).
TargetIdThe export target id (>= RPT_EXP_CUSTOM_BASE).
FnThe export callback thunk.
UserDataOpaque pointer handed back to the callback.

Return value. True once registered; False for a bad engine handle, NULL callback, reserved id, or an unverified runtime.

See also. rptExport, rptRegisterFunction, rptLoadPlugin.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Reporting
Category

Reporting

Exported names

rptRegisterExporter

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.