[JavaScript] Color Highlight - On Render End

This recipe demonstrates how to highlight values based on condition.

Steps taken:

  1. Create a tabular report template (Orderreport.rml) using the composite datasource (OrderById.ds).
  2. Define the following parameters in the “Report > Parameters” page:(Param1) Name=MAX, Value=${MAX##1015}
    (Param2) Name=MIN, Value=${MIN##1009}
  3. Enter the below coding to “Group Footer > Sum Field (UNITPRICE) > On Render End”.//after rendering, pass in value to the function
    field = result.getLogicalElement(0);
    if (field.getText() > 100)
    {
    field.setFontColor(“Red”);
    result.setBackgroundColor(“Yellow”);
    }

ColorHighlight-OnRenderEnd

To download the necessary files for this recipe, refer to the attached ZIP package.
ColorHighlight-OnRenderEnd.zip (16.1 KB)