I. Overview
1. Expected effect
When making a pagination report, you want the report to display a fixed number of rows per page, as shown in the following figure:
2. Implementation method
This is achieved by adding conditional formatting to the most parent case. The most parent cell refers to the parent cell of the highest level in the report. For example, cell A1 is the parent cell of cell A2, and cell A2 is the parent cell of cell A3. Cell A1 is the most parent cell.
Note: when the data in a group is less than the number of rows set, only the remaining data in the group will be displayed.
II. Example1: fixed number of rows
1. Report Design
Design the report as shown in the following figure.
2. Set fixed number of rows
Select cell A5, add conditional formatting, and select pagination > paginate after row. Select formula for formula condition type, and click define button to input formula: &A4 % 5 = 0.
&A4 is the serial number of the data in the cell. This condition means that when the serial number is an integral multiple of 5, the line will be paginated, that is, every 5 lines will be paginated. The steps are as follows:
Note: the condition property must be set on the most parent cell, which is not necessarily the first cell in the row.
3. Effect preview
Save the template and click pagination preview. Both app and HTML5 support it, and the preview effect is similar. The effect is the same as expected in Section I.1.
III. Example2: Dynamic number of rows
The first example is the fixed number of rows per page, and the next example is the dynamic display of rows per page in each group (10/20/30/40).
1. Report Design
The report design is the same as example1, you can refer to the figure under II.1.
2. Add widget
1) Edit the parameter pane and add a label widget. The value of the widget is set to number of rows, as shown in the following figure
2) Add a drop-down box widget, set the data dictionary type to custom, and add a value, as shown in the following figure:
3) Click predefined widget to display the query button and add it to the parameter pane, as shown in the figure below:
3. Set dynamic number of rows
Select cell A5, add conditional formatting, and select pagination > paginate after row. Select formula for formula condition type, and click define button to enter formula: &A4 % $PageSize = 0.
&A4 is the serial number of the cell data, and $PageSize is the value of the drop-down box. This condition indicates that when the serial number is an integral multiple of $PageSize, the line is paginated, that is, every $PageSize line is paginated. The steps are as follows:
Note: the condition property must be set on the most parent cell, which is not necessarily the first cell in the row.
4. Effect preview
PC terminal
Save the template and click pagination preview. Both app and HTML5 support it, and the preview effect is similar. The effect is as follows:
IV. Template download
1. Example1: fixed number of rows
For completed templates, please refer to:
%fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\BasicApplication\FixRowPerPage.cpt
Click to download the template:
2. Example2: dynamic number of rows
For completed templates, please refer to:
%fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\BasicApplication\DynRowPerPage.cpt
Click to download the template:
V. Precautions
1. Fixed row limit
1) In pagination preview, if the table in the template adaptive attributes setting is "horizontally adaptive or not adaptive", then the table will be displayed in pagination when the number of rows exceeds the page size. If not, please refer to the document: horizontally non pagination.
2) There is a certain limit on the number of rows displayed without pagination. When the table is "horizontal adaptive or non adaptive", the maximum number of rows displayed is 1016. When the table is "bidirectional adaptive", the maximum number of rows displayed is 2561.
3) When "freeze row" is set, the row height is limited, and bidirectional adaptation does not take effect, which is equivalent to "lateral adaptation or non adaptation".
2. invalid column grouping table
When the table is displayed in the form of column grouping, the fixed number of rows pagination set is invalid. You can change the data setting to "list".