Using report expressions, another feature of JasperReports, we can display calculated data on a report. Calculated data is the data that is not static and not specifically passed as a report parameter or a datasource field.
Report expressions are built from combining report parameters, fields, and static data. By default, report expressions can be built using the Java language, but JasperReports can support any other language supported by the JVM. The JasperReports project file includes examples of using BeanShell and Groovy to build report expressions.
Note
By far the most commonly used report expressions are Java expressions, so we will cover only those. Refer to the examples distributed with the JasperReports project ZIP file if you need to create expressions in BeanShell or Groovy.
We have already seen simple report expressions in the form of report parameters and fields. We can use any valid Java language expression that returns a string or a numeric value as report expressions...