Report Scripting

Applies to: Kyvos Reporting


Kyvos Reporting Studio allows customization of report behavior through JavaScript-based scripting using the Script Editor. Scripts are associated with specific events triggered during report execution or rendering. Event handling enables dynamic layout, data manipulation, and error control.

Important

Always place event-specific logic within the correct event handler to ensure accurate execution.

Report-Level Events

The following events are available at the report level:

Event

Description

Event

Description

OnReportStart

Triggered before report components (fields, sections) are constructed. Use this to initialize global variables or control report execution flow.

OnReportEnd

Triggered after the report execution is completed. Useful for cleanup or summary actions.

OnPageStart

Fired before rendering each page. Does not guarantee previous page display is complete.

OnPageEnd

Fired after rendering each page.

OnHyperlink

Triggered when a user clicks a hyperlink in the report output. Receives parameters such as mouse button and URL.

OnDataInitialize

Triggered after the report is loaded and SQL fields are created. Use this to add/remove fields dynamically before data fetching begins.

OnFetchData(eof)

Fired after each row is fetched from the database. Allows data manipulation and real-time calculations.

OnNoData

Triggered when the report query returns zero rows.

OnPrintProgress(PageNumber)

Fired when the printing process advances to the next page (sending data to printer driver).

OnError(Number, Description, Scode, Source, HelpFile, HelpContext, CancelDisplay)

Triggered when an error occurs during report execution. Allows you to suppress or customize error messages.

Section-Level Events

Each report section supports the following events. Event execution depends on summary object dependencies and layout structure.

Event

Description

Event

Description

OnFormat

Fired after data is loaded into fields but before the section is laid out. Use this to modify control layout, visibility, and section height.

OnBeforePrint

Triggered before the section is rendered to the output. Use for setting control values. Avoid accessing report fields directly—use hidden controls if needed.

OnAfterPrint

Triggered after the section is rendered. Use this to update counters or flags used in later sections or for logging/report summary.

Note

OnFormat is the only event where you can change the height of a section at runtime.

Copyright Kyvos, Inc. 2026. All rights reserved.