How To Print A Line At The End Of "Detail"

This recipe demonstrates on displaying a line after detail record by using Java code.

  1. Create a report template (FruitSales.rml) using the given datasource (FruitSales.ds).
  2. Add a “Line” element below the data fields in the “Details”.
  3. Add the Java code into “Line > Properties > Script-> Render If”://Print this line only at the last detail record
    Data.getRecordIndex() == Data.getRecordCount()-1;


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