Band rendering order

In this article, let's review the steps to render the bands of the report and define the relationships at the first level of nesting. At the first level of nesting, the report has no hierarchy, only simple lists, only simple groups, and so on. All bands can be categorized into the following types:

Page bands are page headers, page footers and overlays. These bands are related to the report page and appear on each page of the report.
The report bands are Report Title and Report Summary. As the group name suggests, these bands are interconnected with the report and are used to display the report title and summary. They are displayed only once.
Wristbands are data bands, hierarchical bands. In the text below, we will refer to data bands, but also mean that they can be used instead of hierarchical bands.
The bands associated with the data band are header band, footer band, group header band, group footer band, column header band, column footer band, empty band.
The Child Band

Order of bands in report template

All bands are displayed in strict order. This is because each band has a specific function in the report. And the order in which you print the bands is very important.

orderband nameexplanation
1page headereach page. Printing the first page is optional.
2report titleonce at the beginning of the report. The report title band can be printed before the page header band if the page on which both bands are placed has the TitleBefore Header property set to true.
3header,column headerOnce before data output (for column headers - once per column. New per-page output is optional.
4group headerat the beginning of each group. Output to each new page is optional.
5dataOnce per row of data.
6empty bandFor each empty line on every page of the report.
7Group footerat the end of each group.
8footer,column footerAfter all data is output (for column footers - once per column). Output to each new page is optional.
9Report overviewOnce at the end of the report.
10OverlayOnce for every page of the report.
11page footerall pages. Printing the first page is optional.
information:Components placed directly on the page (not placed in any band) are printed first, then the bands.

Child bands can be placed in any band except 'Page Header', 'Report Summary' and 'Page Footer'. The image below is a report page template showing band positions.


Rendering order

When rendering a report, the pages of the report template are processed in order. The order in which pages are processed is determined by their position in the report tree. The higher the page position in the report tree, the higher the priority (order) for processing.

For the report tree shown above, the page processing order is Page1 first, then Page5, Page4, Page3, and finally Page2. Suppose all the bands were placed on Page1 (see example report template page showing band positions above). In this case the bands are processed in several steps.

In the first stage, we do a preliminary analysis of all the bands and determine the positions of the next page bands Page Header Band 1, Page Footer Band 1 and Overlay Band 1. These bands are always processed primarily during report rendering and are added to each new page. Also, the report title band 1 is added to the first page of the rendered report.

 caution:If the Title Before Header property is set to true, report title band 1 is processed and added first to the first page, then page header band 1.

 The second step is to analyze the other bands.

information:You need to understand that other bands are related to the data band and their rendering depends on the data band. Therefore, the data band is detected and analyzed first, then the other bands.

After analysis, the report will start to render. Report Summary 1 is processed last.

band relationship

As above, all bands in report rendering (except PageHeaderBand1, PageFooterBand1, OverlayBand1, ReportTitleBand1, ReportSummaryBand1) depend on DataBand1. Let's consider these relationships in more detail and start with a simple example. data band,Placed on the template page.

The number of records in the data source is 5, which means the data band will be printed 5 times.

Almost all bands can be divided into two categories: headers and footers. Each header corresponds to a footer of the same type.

 caution:If the number of headers and footers is equal, each header corresponds to its own footer. The "header-footer" correspondence is considered from the data band, not top to bottom of the page. Let's say you have 1 data band, 2 headers and 2 footers.

The order of the bands on the page (top to bottom).

orderband name
1HeaderBand3
2HeaderBand2
3DataBand2
4Footer Band 3
5Footer Band 2

in this case,HeaderBand3 iscorresponds toFooter Band 2 ,as well asHeaderBand2 isEquivalent to FooterBand3. In other words, the first header of the data band corresponds to the footer of the first data band. Here is an example of the rendered report:

There are often different numbers of headers and footers for a particular type. For example, if you modify the example above and add HeaderBand4 between HeaderBand2 and DataBand2, HeaderBand4 corresponds to FooterBand3 (yellow in color), HeaderBand2 corresponds to FooterBand2 (turquoise in color), but HeaderBand3 (blue in color) Bands do not have footers.

 caution:Headers and footers are printed only once before and after the data band, and their number is unaffected. Headers and footers are displayed for each group, and each group's header corresponds exactly to the group's footer. In complex reports with different numbers of headers and footers in groups, the relationship between headers and footers can get messy. Therefore, it is recommended to have the same number of groups bands, headers and footers in the report template.
information:Set the height to zero if the bands shown in the report template do not appear in the report.

In the example above, let's equalize the number of headers and footers in the data.

In this case, HeaderBand4 corresponds to FooterBand3 (yellow), HeaderBand2-FooterBand4 (turquoise), HeaderBand3 (blue)-FooterBand2 (zero height). At the same time FooterBand4 is not printed (visible) in the rendered report.

Therefore, the report will display headers and footers evenly, making it easy to determine their correspondence. At the same time, you can turn off (not display) specific bands. All of the above examples were considered Header Bands and Footer Bands. The same principle applies to the group header band, group footer band, column header band, and column footer band.

Below is an example where the report has several data bands.
 

These bands are not related to each other. So they are processed in order. First, DataBand1 (category list) is processed, then DataBand2 (product list).

Then add a header band to your report template. A data band that refers to a header band, above which it is placed. In order for HeaderBand1 to correspond to DataBand1 (list of categories), it must be placed above this databand.

In order for HeaderBand2 to be related to DataBand2 (product list), it must be placed directly above this Data Band.

And the first page of the report looks like this:

Next, think about the relationship between footers and multiple data bands. As shown above, the footer in the report template only points below this data band and is placed directly below it. At the same time, the footer band also concludes the header band. For example, say you want to display the total value by the number of categories. In this case, FooterBand1 should be placed below the data band, which displays the list of categories, and above HeaderBand2, which displays the list of products.

The report page looks like this:

In order to display totals in a databand with a list of products, FooterBand2 must be placed below DataBand2. In this example, let's use the Sum function to calculate the total price of all products. This result will be displayed on each page of the report (set the Print on All Pages property to true). Below is a page template showing a list of products with a footer near the data band.

And the first page of the report looks like this:

 caution:In the example above,HeaderBand2UnderFooter Band 1placement is not accurate.  
In this case FooterBand1 and HeaderBand2 do not refer to any data bands. When rendering a report, first all data bands are defined. Then, for each databand, the headers associated with this databand are defined. All of these headers sit above one footer band or another data band. Then the footer related to this data band is defined. These footers are placed below the next header or another data band. So in the rendered report DataBand1 has no footer, DataBand2 has no header and HeaderBand2 and FooterBand1 are not displayed as they do not belong to any databand.

The same principle of correspondence applies to the group header band, group footer band, column header band and column footer band.

The header is placed above the associated data band and the footer below. Headers and footers cannot be printed by themselves, as they must reference specific data bands.

Always check the number of headers and footers, especially in reports with groups. It may be easier to add specific bands (headers or footers) so that their number is equal and the lines are clearly traced. - Set band height to zero in the report template if you want to hide the band in the rendered report.