Charts and Subreports
Harry
· 24 Sep 2026
· 1 views
Log in to track your progress and mark lessons complete.
Adding a Chart
Drag a chart element (bar, pie, line) onto the Summary band, then bind its category and value expressions to fields: $F{dept} vs $F{salary}. Charts render in every export format automatically.
Subreports for Master–Detail
A subreport is a separate .jrxml embedded via the Subreport element — e.g. an order header with its line items. Pass the child data with new JRBeanCollectionDataSource(order.getItems()) as a parameter, and reference the compiled .jasper path in SUBREPORT_DIR.