This recipe demonstrates how to highlight values based on condition.
Steps taken:
- Create a tabular report template (Orderreport.rml) using the composite datasource (OrderById.ds).
- Define the following parameters in the “Report > Parameters” page:(Param1) Name=MAX, Value=${MAX##1015}
(Param2) Name=MIN, Value=${MIN##1009} - 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”);
}
To download the necessary files for this recipe, refer to the attached ZIP package.
ColorHighlight-OnRenderEnd.zip (16.1 KB)