FineReport report pagination settings

1. Problem description

When filling in FineReport data, if the amount of data is too large, due to the performance limitations of the front-end browser, if all the data is displayed, the speed will be very slow, which will affect the user experience. At this time, everyone will wonder whether filling in the report can be like paging preview. Pagination is performed in the same way, so that only the current page is loaded, thereby improving performance. Next, we will introduce the production and browsing process of filling and reporting pagination. Under op=write, use the __cutpage__=v parameter (that is, add &__cutpage__=v after the url) to enable horizontal paging without vertical paging.

 

 

2. Example

Below we take 1000 rows of data as an example, each page displays 200 rows and is displayed in 5 pages.

2.1 Data Preparation

Create a new dataset ds1: SELECT top 1000 * FROM order details.

ds2: SELECT * FROM product.

2.2 Template Design

As shown in the figure below, drag the data column in the template body to cells C2~O2, and set the title:


2.3 Filtering

The data column comes from 2 data sets. You need to set the filter condition in the cell. Double-click the E2 cell, select filter, and set the condition to be the product id equal to the cell D2, as shown in the following figure:


Note: In the data column, the parent cell of the data column from ds1 needs to be set to C2, and the parent cell of the data column from ds2 needs to be set to E2.

2.4 Paging settings

In the form of paging preview, each page displays a fixed number of rows, and the report paging is also set in the same way, as shown in the figure below, add a conditional attribute to the C2 cell:


2.5 Repeat header row, freeze row and column settings

Since the above report body contains many data columns and the amount of data is relatively large, when viewing the report on the web side, it is necessary to set a repeated header row, and freeze the rows and columns, so that when viewing the report, you can still know the data of the row. significance.

repeat header row

Select the header row, right-click, and select Set Repeat Header Row.

Freeze the ranks

Click Template > Repeat and Freeze Settings in the menu bar, and freeze the first row and the third column in the Freeze column, as shown below:


2.6 Report style design

Set the style for the FineReport report , as shown below:


2.7 Effect View

Click the fill-in preview and add the parameter __cutpage__=v after the URL to enable fill-in pagination and view the effect:

 

在线查看模板效果请点击Cutpage.cpt

 

注:填报分页状态下,翻页前,如果修改了当前页的数据,需先保存该页面内容,即传输到服务器端进行保存,那么下次再查看该页内容时,页面显示内容即为编辑后的内容,在保存的过程中,不允许编辑,保存不是提交,报表会自动保存。

另:__cutpage__参数前后都有2个下划线。

本文首发CSDN:http://blog.csdn.net/nayun123/article/details/73527535

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326618242&siteId=291194637