API referenceReporting

rptSetParamInt

Bind a named report parameter to a string, floating-point,

C
BOOL32 __stdcall rptSetParamStrA(TRPTJOB Job, const char* Name, const char* Value);
BOOL32 __stdcall rptSetParamNum(TRPTJOB Job, const char* Name, double Value);
BOOL32 __stdcall rptSetParamInt(TRPTJOB Job, const char* Name, int64_t Value);
Delphi
function rptSetParamStrA(const Job: TRPTJOB; const Name, Value: PAnsiChar): LongBool; stdcall;
function rptSetParamNum(const Job: TRPTJOB; const Name: PAnsiChar; Value: Double): LongBool; stdcall;
function rptSetParamInt(const Job: TRPTJOB; const Name: PAnsiChar; Value: Int64): LongBool; stdcall;

Purpose. Bind a named report parameter to a string, floating-point, or 64-bit integer value before rendering — the expression language's parameter values, consulted by {{ }} interpolations and expressions throughout the report definition (V16 conceptual chapters 03-04).

Description. All three funnel into SetParamCore(Job, Name, TRptValue), wrapping the typed value into the engine's own tagged TRptValue union (RVStr/RVFloat/RVInt) and calling J.SetParam(Name, Value). Name is always decoded via UTF8ToString regardless of which of the three functions is called — consistent with this whole unit's "A means UTF-8" convention documented above. rptSetParamStrW(Job, Name, nil) sets an empty string rather than failing — a nil value pointer is not treated as an error for the string setter specifically.

Parameters.

ParameterDescription
JobTarget job handle (must be open, not yet necessarily rendered).
NameParameter name (UTF-8 bytes even in the A form).
ValueThe typed value to bind.

Return value. True if Job resolves and Name is non-nil.

C# (P/Invoke)

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

Reporting

Exported names

rptSetParamInt

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.