|
|
||||||||
Project Home |
Tracker |
Documents |
Tasks |
Source Code |
Discussions |
Reports |
File Releases |
Wiki |
Project Admin |
|||||||||||||
| wiki1119: BandsAndGroups | |||||||||||||||||||||||||
Manual for iReport 0.2.0 and above< Back to the TOC5 Bands and Groups 5 Bands and Groups In this chapter we'll see how a report is structured and how to modify this structure. 5.1 Bands A report is composed of a variable set of sections named bands. Every band is defined by a height (that should be considered as a minimal height). If the band height is zero, the band will be never visible. The band height can grow if elements inside it are stretched. A minimal document has:
There is then a special band named "background" that can be used to define a page background (i.e. using a watermark image). The position of a band with respect to other bands can not be modifed. For each band, you can modify the minimum height, the value of a flag that allows splitting a band during the filling process if it's bigger than the portion of page in which it should be printed, and a boolean expression (alias a Java expression that return a Boolean object), with which control is possible if the band is visible or not. If no expression is defined for a band, the visibility is set to "true".
Fig.5.1: Bands button on toolbar Pressing the bands button (see fig.5.1) or selecting the menu item View > Bands , opens the bands form.
From here it's possible to modify the band height and set the band expression. Fig.5.3: Report properties, tab more (menu item View > Report properties) 5.2 Groups If you need to group data, you can add one or more groups. When a group is created, two new bands are added to the report: the group header and the group footer.
A group is defined by an expression. For each record processed, JasperReports evaluates this expression. If the expression value is changed, the group changes. Please note that JasperReports doesn't perform any order on data; so if you use a field as an expression and values for these fields are A B A B, four groups are created, against the expected two (one for each record with the field value set to A, and one for the records number 2 and 3, with the field value set to B). If you present to JasperReports the ordered data (A A B B), it will work fine.
Fig.5.4: Groups button on toolbar Pressing the groups button (or selecting the menu item View > Groups) opens the groups form from which you can handle groups.
Fig.5.5: Group definition form From this form you can set all group properties. < Back to the TOC |
|||||||||||||||||||||||||
|
|