Define report totals (Java)
In your Java report application, define variables for the totals, calculate the values, and output them to the report engine.
OrderReportModel.java, part of
the OrderReportJava demo application. Examine that file to see the code fragments in context of a
complete application. This application accumulates the subtotals on a per-row basis.