A complete report is structured by composing a set of sections called bands. Each band has its own configurable height, a particular position in the structure, and is used for a particular objective. The available bands are: Title, Page Header, Column Header, Detail 1, Column Footer, Page Footer, Last Footer, and Summary.
A report structured with bands is shown in the following screenshot:
Besides the mentioned bands, there are two special bands which are Background and No Data.
Band | Description |
Title | Is the first band of the report and is printed only once. Title can be shown on a new page. You can configure this from the report properties discussed in the previous section of this chapter. Just to review-go to report Properties | More… and check the Title on a new page checkbox. |
Page Header | Is printed on each page of the report and is used for setting up the page header. |
Column Header | Is printed on each page, if there is a detail band on that page. This band is used for the column heading. |
Detail | This band is repeatedly printed for each row in the data source. In the List of Products report, it is printed for each product record. |
Column Footer | Is printed on each page if there is a detail band on that page. This band is used for the column heading. If the Floating column footer in report Properties is checked, then the column footer will be shown just below the last data of the column, otherwise it will be shown at the bottom of the page (above the page footer). |
Page Footer | Is printed on each page except the last page, if Last Page Footer is set. If Last Page Footer is not set, then it is printed on the last page also. This band is a good place to insert page numbers. |
Last Page Footer | Is printed only on the last page as a page footer. |
Summary | Is printed only once at the end of the report. It can be printed on a separate page if it is configured from the report Properties. In the following chapters, we will produce some reports where you will learn about the suitability of this band. |
Background | Is used for setting a page background. For example, we may want a watermark image for the report pages. |
No Data | When no data is available for the reports, this band is printed if it is set as the When no data option in the report Properties. |
Now, we are going to configure the report bands (setting height, visibility, and so on) and format the report elements.
A band becomes invisible in the report if its height is set to zero. We have already learned how to change the height of a band. We can also make a band invisible using the Print When Expression option. If we write new Boolean(false) in Print When Expression of a band, then that will make the band invisible, even though its height is set to greater than zero. If we write new Boolean(true), then the band will be visible. It is true by default.
By default, the Column Footer is placed at the bottom of the page. To show the Column Footer just below the table of data, the Float column footer option must be enabled from the report Properties window.
We can increase or decrease the size of an element by dragging the mouse accordingly. Sometimes, we need to set the size of an element automatically based on other elements’ sizes. There are various options for setting the automatic size of an element. These options are available in the format menu (Format | Size).
Size Options | Description |
Same Width | This makes the selected elements of the same width. The width of the element that you select first is used as the new width of the selected elements. |
Same Width (max) | The width of the largest of the selected elements is set as the width of all the selected elements. |
Same Width (min) | The width of the smallest of the selected elements is set as the width of all the selected elements. |
Same Height | This makes the selected elements of the same height. The height of the element that you select first is used as the new height of the selected elements. |
Same Height (max) | The height of the largest of the selected elements is set as the height of all the selected elements. |
Same Height (min) | The height of the smallest of the selected elements is set as the height of all the selected elements. |
Same Size | Both the width and the height of the selected elements become the same. |
Position | Description |
Center Horizontally (band/cell based) | The selected element is placed in the center of the band horizontally. |
Center Vertically (band/cell based) | The selected element is placed in the center of the band vertically. |
Center (in band/cell) | The selected element is placed in the center of the band both horizontally and vertically. |
Center (in background) | If the Background band is visible and if the element is on the Background band, then it will be placed in the center both horizontally and vertically. |
Join Left | Joins two elements. For joining, one element will be moved to the left. |
Join Right | Joins two elements. For joining, one element will be moved to the right. |
Align to Left Margin | The selected element will be joined with the left margin of the report. |
Align to Right Margin | The selected element will be joined with the right margin of the report. |
I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…
Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…
Once we learn how to deploy an Ubuntu server, how to manage users, and how…
Key-takeaways: Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…
While developing a web application, or setting dynamic pages and meta tags we need to deal with…
Software architecture is one of the most discussed topics in the software industry today, and…