BOOL32 __stdcall rptRender(TRPTJOB Job);
int32_t __stdcall rptGetPageCount(TRPTJOB Job);
BOOL32 __stdcall rptExportA(TRPTJOB Job, int32_t Target, const char* Path);
function rptRender(const Job: TRPTJOB): LongBool; stdcall;
function rptGetPageCount(const Job: TRPTJOB): Integer; stdcall;
function rptExportA(const Job: TRPTJOB; Target: Integer; const Path: PAnsiChar): LongBool; stdcall;
Purpose. The core render→export pipeline: lay out the report (paginating bands/data per the report definition and bound parameters) into an internal page model, then write that model to any of the built-in export target formats (V16 conceptual chapter 06's table: 0=PDF, 1=HTML, 2=CSV, 3=JSON, 4=XML, 5=TEXT, 6=SVG, 7=XLSX, 8=PNG, 9=BMP, ≥100=a plugin-registered custom exporter).
Description. rptRender calls J.Render, with any exception (expression errors, data errors, format errors) caught and translated into the engine's structured error sink via StoreJobError — which maps ERptExprError/ERptDataError/ERptFormatError to their own specific numeric codes (and, for format errors, appends a Location string identifying where in the report layout the error occurred) — not a generic catch-all failure. rptGetPageCount reads J.PageCount and returns -1 (not 0) if the job handle itself doesn't resolve — a genuine, distinguishable-from-"zero rendered pages" sentinel. rptExport requires the job to already be rendered (implied by J.Export_ operating on the render result) and, like render, routes exceptions through the same structured error sink. Both rptRender and rptExport independently re-verify the engine's license (RuntimeVerify) before doing any work.
Parameters.
| Parameter | Description |
|---|---|
Job | Target job handle. |
Target | The numeric export target ID (see the table above; ≥100 = plugin-registered custom exporter). |
Path | Output file path. |
Return value. True on success; False on any failure (invalid job/license, render/export exception — details via rptGetLastError). rptGetPageCount: the real page count after a successful render; -1 if Job is invalid.
C# (P/Invoke)
public static extern int rptGetPageCount(IntPtr Job);
Reporting
rptGetPageCount
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.