[JavaScript] Render If

This recipe demonstrates the usage of script in the Render If tab of the Section Wizard in the report template.

Steps taken:

  1. Create a report tempalte (renderIfScriptRpt.rml) using the composite datasource (renderIfScriptRpt.ds).
  2. Define the following parameter in the Report > Parameters page:Name=COLA, Value=${COLA##A}
  3. Enter the following script into the Render If tab of Section 1:var ds = DataCacheManager.getCache(“DS1”);
    if(ds.getRecordCount() > 0)
    true;
    else
    false;

Screenshot when COLA=A is entered:

JavaScript-RenderIf

To download the necessary files for this recipe, refer to the attached ZIP package.
RenderIf.zip (3.9 KB)