Jasper Basics
This page summarizes the JasperReports concepts that matter most in ADITO projects. It is intentionally selective: the goal is not to replace the full vendor documentation, but to make the ADITO reporting pages easier to understand.
Design model
A Jasper report is a layout template. It does not fetch business data by itself in the recommended ADITO setup. Instead, ADITO prepares data in JDito and passes it into the report as fields, parameters, and optional subreport datasets.
In practice, this means:
- JasperReports is responsible for layout and rendering.
- JDito is responsible for data preparation.
- ADITO views and actions are responsible for opening the report in the client.
Bands
The report canvas is divided into horizontal areas called bands. Each band has its own repetition behavior.
| Band | Typical use |
|---|---|
Title | Printed once at the beginning of the report |
Page Header | Repeated on each page |
Column Header | Header labels for tabular detail content |
Group Header | Printed when a group starts |
Detail | Repeated for each dataset row |
Group Footer | Printed when a group ends |
Column Footer | Footer for a column area |
Page Footer | Repeated on each page, often for page numbers |
Last Page Footer | Special footer for the last page |
Summary | Printed once at the end |
Background | Used for watermarks or visual background elements |
For most ADITO reports, the most important bands are Page Header, Column Header, Detail, and optionally Group Header / Group Footer.
Columns
Columns split the detail area into vertical lanes. They are useful for layouts such as label sheets or compact address outputs where multiple datasets should be printed next to each other.
Use columns only when the printed format really requires them. For most business documents, a single-column layout is easier to maintain.
Common elements
Everything visible in a report is built from elements. The most important ones are:
Static Text: fixed labels that never changeText Field: dynamic values or expressionsImage: logos, signatures, or other imagesLine,Rectangle,Ellipse: visual structureBreak: explicit page or column breakSubreport: embeds another report inside the current one
Static text vs. text fields
Use a Text Field whenever the text comes from data or needs to be translated. In multilingual projects, labels that must follow the ADITO client language should usually be implemented as expressions with $R{...} instead of hard-coded static text.
Fields, parameters, and variables
JasperReports stores values in three different ways:
| Type | Purpose |
|---|---|
Field | Repeated data from the main dataset |
Parameter | Single values passed into the report, such as dates, labels, flags, or subreport datasets |
Variable | Calculated values inside the report, for example totals or counters |
In ADITO projects:
- fields usually come from
ReportData, - parameters are used for one-off values and special handover mechanisms such as
adito.image.*oradito.datasource.*, - variables are useful for page numbers, counters, or report-local calculations.
Layout hygiene
A few basic layout rules save time later:
- Delete unused bands instead of leaving large empty areas behind.
- Keep band heights tight so records do not waste vertical space.
- Reuse text formatting consistently instead of styling each field from scratch.
- Prefer simple structures first, then add groups or subreports only where needed.
What belongs in Jasper and what belongs in JDito?
As a rule of thumb:
- Put layout, formatting, and simple display expressions into JasperReports.
- Put SQL, data aggregation, filtering logic, and report orchestration into JDito.
Avoid direct report-to-database connections where possible. In ADITO, the preferred approach is to provide the data explicitly from JDito so the report stays predictable and easier to test.