Report Generator FastReport .Net User Guide: Multicolumn, "Booklet" style reports

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.

Multicolumn report

A normal report will print data if it does not reach the end of the page. When a new page is formed, continue printing. Reports with columns print data in several columns. When the end of the page is reached, printing continues in a new column on the same page. A normal report can be viewed as a report with one column.

In FastReport, there are two ways to print columns.

page column

The first method is based on setting the number of columns of the report page. This is done on the "Columns" tab of the "Page Setup" window:

As you can see, you can set the following column parameters:

  • Number of columns
  • column width
  • the position of each column

In order to turn a normal report into a column report, you just need to set the number of columns on the page. The remaining parameters FastReport will calculate by itself. When you enable columns, the ribbon mode in the designer changes:

The area shown in gray cannot be used to place objects, it is only used to print the next column of objects.

To handle columns, the "Column Header" and "Column Footer" bands are used. As you can tell from their names, they are printed at the top and bottom of each column respectively. The image below shows the print order in a columnar report:

Data with columns

Another way of printing multi-column reports is based on using "Data" with columns. The rest of the tape continues to print in one column.

The parameters of the columns can be configured using the "Columns" property, which can be changed in the "Properties" window. You can set the following parameters:

  • number of columns
  • column width
  • The print mode for the columns. You can choose one of the two modes "AcrossThenDown" and "DownThenAcross";
  • If the selected mode is "DownThenAcross", the minimum number of rows in a column.

Column strips can be printed in either of two modes. In "AcrossThenDown" mode (the default mode), the columns are printed as follows:

In "DownThenAcross " mode, column printing occurs in the following way:

In this mode, the way FastReport counts the number of rows of data in a column, the column is filled evenly. You can also set the minimum number of rows in a column via the "Columns.MinRowCount" property.

"Booklet" style reports

When printing a report in booklet form, you may face the following requirements:

  • Independent report pages - cover, table of contents, report content, back cover
  • Even and odd pages have different margins
  • Different headers and footers for even and odd pages

Add page to report

You can add any number of pages to a report template. On each page you can place a separate report. To add a new page, click on the toolbar

button. It can also be done by pressing the "Add New..." button and selecting the "Report page

For creating the "Table of Contents" section, you can use the techniques described in the "Interactive reports" chapter to add to the page. 

page settings

In the "Page Setup" window you can instruct FastReport that the left and right margins of even pages should be mirrored:

1

All report objects have a "PrintOn" property. Using this property, you can print different objects on odd and even pages.

This property can be set in the "Properties" window.

This property determines which pages the object can be printed on. This attribute can have one or any combination of the following values:

  • FirstPage
  • LastPage - The report must be double-paged
  • OddPages
  • EvenPages
  • Repeated Band. This value refers to the "RepeatOnEveryPage" property set to "true" with
  • SinglePage - the report must be double-passed

By default, the value of this property is equal to "FirstPage, LastPage, OddPages, EvenPages, RepeatedBand, SinglePage". Indicates that the object will be printed on all pages of the report. If the report has only a single page, the object's visibility is determined only by the SinglePage value.

We'll give a few typical examples of using this property:

Property value Where the object will be printed
FirstPage  Only on the first page.
LastPage, OddPages, EvenPages, RepeatedBand on all pages except the first.
FirstPage, OddPages, EvenPages, RepeatedBand This is true for all pages except the last one.
RepeatedBand Only on bands where the "RepeatOnEveryPage" property is set to "true".
FirstPage, LastPage, OddPages, EvenPages On all bands except the one that repeats.
FirstPage, LastPage, OddPages, RepeatedBand Only on odd pages.
FirstPage, LastPage, EvenPages, RepeatedBand  Only on even pages.

To print different text on odd and even pages, put two "Text" objects on a band and set them up like this:

  • The first object will be printed on odd pages. Set its "PrintOn" property to "FirstPage, LastPage, OddPages, RepeatedBand" (that is, all values ​​except "EvenPages").
  • The second object will be printed on even pages. Set its "PrintOn" property to "FirstPage, LastPage, EvenPages, RepeatedBand" (that is, all values ​​except "OddPages").

These objects are not printed at the same time, so you can place them on top of each other.

All straps have the same properties. To print different bands on odd and even pages, you can use "Child" bands. You can attach it to any band; this can be done in the "Configure Bands" window. Set up the main band and its sub bands in the following way:

  • Master tapes will be printed on odd-numbered pages. Set its "PrintOn" property to "FirstPage, LastPage, OddPages, RepeatedBand" (that is, all values ​​except "EvenPages").
  • Subbands will be printed on even-numbered pages. Set its "PrintOn" property to "FirstPage, LastPage, EvenPages, RepeatedBand" (that is, all values ​​except "OddPages").

Ribbons can have different heights, appearances and contents. See the example below, it prints different headers

1

If you need to start printing on an odd page, set the "StartOnOddPage" property to true. When needed, FastReport prints blank pages before starting to print the specified pages.

Guess you like

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