Scripting in Intellicus

Scripting in Intellicus

Scripting in Intellicus enables you to dynamically control the behavior of reports, controls, and parameters at runtime. You can use scripts to perform actions such as:

  • Show or hide a report field based on specific conditions

  • Render or skip a report section

  • Show or hide a parameter on the Input Parameter Form

  • Validate values entered for input parameters

  • Modify the SQL dynamically at runtime (e.g., add filters, change table names)

Types of Scripts

Intellicus scripting is categorized into the following types:

SQL Scripts

Use scripts within SQL statements to dynamically generate queries at runtime. This is useful for appending clauses, changing table names, or customizing conditions based on user input.

Parameter Scripts

Use parameter scripts to:

  • Validate user input using expressions or logic

  • Dynamically change the visibility or behavior of UI elements on the Input Parameter Form

  • Trigger custom behavior on parameter events such as onSubmit

Report Scripts

Use report scripts to control the report layout and rendering behavior. Scripts can be executed at different report lifecycle events such as:

  • onReportStart()

  • onDataFetch()

  • onGroupStart()

  • onGroupEnd()

  • onReportEnd()

Accessing Report Objects

You can access and manipulate various report objects using a predefined object hierarchy. These objects and their properties are available in the scripting editor and are context-sensitive—each object supports specific events, and each event allows access to relevant properties.

Examples of Scripting Use Cases

  • SQL Script: Dynamically append a WHERE clause using a parameter value.

  • Parameter Script: Hide the end date parameter if the report type is “Daily”.

  • Report Script: Suppress the detail section if no data is returned.

Scripting Interface

The scripting editor provides access to a code editor interface with contextual options:

  • Choose the object (Report, Group, Section, Field, etc.)

  • Select an event applicable to that object

  • Write your script using supported language syntax (e.g., JavaScript)

This figure illustrates how scripting objects and events are configured in the report.

image-20250728-122748.png

Read more:

 

Copyright Intellicus Technologies Pvt. Ltd. All rights reserved.