Bands, Fields and Static Text

Harry · 24 Sep 2026 · 1 views
Log in to track your progress and mark lessons complete.

Designing the First Report

Drag a Static Text element into the Title band for the heading, add column headers, then place Text Fields with expressions like $F{name} in the Detail band — it repeats once per record.

<field name="name" class="java.lang.String"/>
<field name="salary" class="java.lang.Double"/>

Title header detail footer bands

Filling with JavaBeans

List<Employee> staff = dao.findAll();
JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(staff);
JasperPrint print = JasperFillManager.fillReport(report, new HashMap<>(), ds);

Bean getters (getName()) map to fields ($F{name}) by naming convention.

Share this post:

Comments (0)

Please login or register to comment.

Create a free account to keep reading

You've enjoyed a free tutorial! Register (it's free) to unlock every tutorial, track your progress and save code.

or sign in with your account

Already have an account? Log in