Report Generator FastReport .Net User Guide: Band related introduction

FastReport .Net is a full-featured Windows Forms, ASP.NET and MVC report analysis solution. Using FastReport .NET can create .NET reports independent of applications. At the same time, FastReport .Net supports 14 languages ​​such as Chinese and English. You can make your products truly international.

With the official release of the FastReport .NET  2023 version, the manufacturer has also released the latest version of the user manual. This time we have updated the eighth section of the 2023 version of the user manual, mainly explaining "Bands", hoping to help everyone.

Bands is an object that sits directly on the port page and is a container for other objects such as "text", "picture" and others.
In FastReport, there are 13 types of strips in total. Depending on its type, bands are printed at specific positions on the report.

How to print Bands

report title

It prints once at the beginning of the report. You can choose the order of printing -- before or after the "header" -- with the help of the "header" property.

Header "with before or after" with the help of the "title before header" page property. Changing this property can be done with the help of the "Properties" window. By default, this property is equal to "True", that is, the report title is printed before the header.

report summary It prints once at the end of the report, before the "footer" band, after the last row of data
page title

Printed at the top of each page of the report

page number footer printed at the bottom of each page of the report
column title Use this banding when printing multi-column reports (when the number of columns > 1 indicated in the page setup). setting > 1). It is printed at the top of each column after the header band.
column footer printed at the bottom of each column, before the footer band
data This tape is connected to the data source and printed as many times as there are rows in the source.
data title This section is connected to the "data" section and is printed before the first line of data.
data footer This strip is connected to the "data" strip and is printed after the last row of data.
each set of headings It is printed at the beginning of each group, when the value of the group condition changes.
group footer is printed on the back of each group
Additional belt This strap can be attached to any strap, including another sub strap. It is printed immediately after its parent.
cover Printed on every report page as a background
Band properties

Each Band has several useful properties that can affect the printing process.

To do this, right-click on an empty spot on the Band, not occupied by another object. Additionally, it
can also be accessed by clicking on the Band's head (if using Classic Display Mode) or the Band Structure (otherwise).

Another way is to select a Band and change the corresponding properties in the "Properties" window.

Attributes describe
growable, shrinkable

These properties determine whether the Band can grow or shrink, depending on the size of the objects contained in the Band.

depends on the size of the object. If both properties are disabled, the strap will always have the dimensions specified in the designer

The specified size. Please  read more about this issue in the " Report Creation " chapter.

CanBreak If this property is enabled, FastReport will try to print part of the strip on the available space.
Print a part of the content on the space, that is, "break" the Band.  Read more about this in the " Report Creation " chapter.
start new page Printing a band with this property starts on a new page. This property is typically used when printing groups; that is, each group is printed on a new page.
bottom print Bands with this attribute are printed at the bottom of the page, before the "footer" band.
This is useful when printing some documents, since the sum should be printed at the bottom of the page.
This is useful when printing certain files where the sum should be printed at the bottom of the page
repeat on every page These Band "data headers", "data feet", "group headers" and "group feet" - all have this property. This type of band will be printed on each new page when the data is printed.
Please  read more about this issue in the " Report Creation " chapter.
Bands in the designer

Bands in the designer appear as rectangular areas. Like many other report objects, bands have borders and fills (by default, they are disabled). Otherwise, strip charts display a grid. To set the grid mode, you need to enter the grid mode you want to set, then enter the "View|Options..." menu and select "Report Page". The grid can also be enabled or disabled in the View menu.

You can set the height of the strap in three ways:

  • Place the mouse pointer on the bottom of the strip, and the cursor shape will change to "Horizontal Splitter". You can adjust the size of one strap.
  • Drag the tape handle on the left ruler.
  • Use the Properties window to set the height property of the tape.

The designer has two modes for displaying bands, and you can switch between the two modes at any time. in the first mode.
Each band has a header, which contains the title of the band and useful information about it (for example, the name of the data source it is connected to)


In the second mode, the strap has no head. Instead, on the left side of the window, the structure of the bands is shown.
This mode helps to understand the structure of the report, especially if it was not created by you.

You can switch between these modes by clicking the buttons below.

Configure Bands

You can set the bands in the "Configure Bands" window. It can be called from "Reports|Configure Bands...". menu, or using the "Configure bands" button, placed on the bands tree.

In this window it is possible to add Bands to the report, delete them or change their order. To add a Bands, you need to click the "Add" button or right click on the Bands tree. To add another Band, click the "Add" button or right-click on the Bands tree, a context menu with a list of bands will appear, and a band that cannot be added will be dimmed.

The Add" action depends on what band is selected in the band tree.

For example, adding "Data Header" and "Data Footer" is only possible if the "Data" band is selected beforehand, there is also another way to configure some bands. This can be done from the "Reports" menu.

To delete a band, select it and press the "Delete" key.

When configuring stripes, FastReport does not allow operations that result in the creation of incorrect report templates. For example, you cannot delete the "data" band connected to a group, so you need to delete the group first. Another example, when the "data" segment is deleted, its header and footer are automatically removed, making it impossible to delete a band if it is the only one on the page.

Print Bands

How does FastReport need to write a report if there are several tapes on the page? Let's look together

Like the following example:

The "Report Header" band will be printed first, followed by the "Page Header" band, and then the "Data" band will be printed as many times as there are rows in the data source to which the band is connected.
After all the rows of the "Data" Band are printed, the "Report Summary" Band will be printed, and the bottom of the page is the "Footer" Band.
The printing of the report is completed, and a printed report is as follows:

During printing, FastReport checks whether there is enough space on the current page of the prepared report for printing. If there is not enough space, the following occurs:

  • Print the footer.
  • Add a new page.
  • Print the header.
  • Continue to print the unsuitable Band on the previous page.

Guess you like

Origin blog.csdn.net/m0_67129275/article/details/131765766