iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library

13.07.2015 Views

iReport Ultimate GuideConsecutive zero-height bands may become obscured while working in the design panel. You can increase the heightof a selected band by pressing the Shift key while dragging the bottom margin of the band down.The Print When Expression property is used to hide or display the band under the circumstances described by theexpression. The expression must return a Boolean value. In particular, it must return true to display the band and false to hideit. By default, when no value is defined for the expression, the band is displayed.UR reserves enough space in a page for bands like the title, the page header and footer and the column header andfooter. All the other bands cannot fit in the remaining space when repeated several times. This may result in a Detail bandbeginning in one page and ending on another page.If you want to be ensure that a band displays completely within one page, deselect the Split allowed property. Every timethe band is printed, UR will check the available space in the current page. If it is not enough, the band will start onthe next page. Of course, this does not mean that the band will completely fit in the next page, this still depends of the bandcontent.The default report template includes all the pre-defined bands, except the Last Page Footer and the No Data bands. If you arenot interested in using a band, you can remove it by right-clicking the band (or the band node in the outline view) and selectingthe menu item Delete Band. When a band is no longer present in the report, it is displayed as a grayed node (see Figure 7-2).To add the band to the report, right-click the band and select Add Band.Figure 7-2Adding a pre-defined bandIn general, there is no valid reason to remove a band apart the generation of a less complex JRXML file (the report sourcecode). In order to prevent the printing of a band, set its height to 0. The only exceptions are the Last Page Footer and No Databands.If present, the Last Page Footer band always replaces the Page Footer band in the last page, so if we don’t want or need thisbehavior the band must be not present. The No Data band is a very special band that replaces the entire report if the data sourcedoes not contain any records and if, at the document level, the property When No Data Type has been set to No DataSection.7.2 Working with GroupsGroups allow you to organize the records of a report in order to create some structures. A group is defined through anexpression. UR evaluates this expression thus: a new group begins when the expression value changes. An112

Bands and Groupsexpression may be represented just by a specific field (that is, you may want to group a set of contacts by city, or country), butit can be more complex as well. For example, you may want to group a set of contact names by initial letter.Figure 7-3Group bandsEach group can have one or more header and one or more footer bands. Group headers and footers are printed just before andafter the Detail band. You can define an arbitrary number of groups (that is, you can have a first-level group that containscontacts by Country and a nested group containing the contacts in each country by City).The order of the groups in the Report Inspector determines the groups’ nesting order. The group order can be changed by rightclickinga group node (header or footer) and selecting the Move Group Up or Move Group Down menu items (see Figure 7-4on page 113).Figure 7-4Changing the groups order113

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>Consecutive zero-height bands may become obscured while working in the design panel. You can increase the heightof a selected band by pressing the Shift key while dragging the bottom margin of the band down.The Print When Expression property is used to hide or display the band under the circumstances described by theexpression. The expression must return a Boolean value. In particular, it must return true to display the band and false to hideit. By default, when no value is defined for the expression, the band is displayed.UR reserves enough space in a page for bands like the title, the page header and footer and the column header andfooter. All the other bands cannot fit in the remaining space when repeated several times. This may result in a Detail bandbeginning in one page and ending on another page.If you want to be ensure that a band displays completely within one page, deselect the Split allowed property. Every timethe band is printed, UR will check the available space in the current page. If it is not enough, the band will start onthe next page. Of course, this does not mean that the band will completely fit in the next page, this still depends of the bandcontent.The default report template includes all the pre-defined bands, except the Last Page Footer and the No Data bands. If you arenot interested in using a band, you can remove it by right-clicking the band (or the band node in the outline view) and selectingthe menu item Delete Band. When a band is no longer present in the report, it is displayed as a grayed node (see Figure 7-2).To add the band to the report, right-click the band and select Add Band.Figure 7-2Adding a pre-defined bandIn general, there is no valid reason to remove a band apart the generation of a less complex JRXML file (the report sourcecode). In order to prevent the printing of a band, set its height to 0. The only exceptions are the Last Page Footer and No Databands.If present, the Last Page Footer band always replaces the Page Footer band in the last page, so if we don’t want or need thisbehavior the band must be not present. The No Data band is a very special band that replaces the entire report if the data sourcedoes not contain any records and if, at the document level, the property When No Data Type has been set to No DataSection.7.2 Working with GroupsGroups allow you to organize the records of a report in order to create some structures. A group is defined through anexpression. UR evaluates this expression thus: a new group begins when the expression value changes. An112

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!