1. Description of the problem
Such a report: The report form is very simple, just a simple single data source detail report, but the volume of data is very large, million, tens of millions or more. Report fetching and calculation time is quite long.
Hope to improve the presentation speed of the report, for users, the query report will not have a lag feeling.
Solution Delivery Tool: report development tool Finereport.
2. Solution
2.1 Solutions
for Single data source Drilldown report line engine to execute the report
2.2 Principle
General report: take out all the data before executing the report, and finally return the overall report results to the browser, the user access to see the results of the time = report take time + report execution time;
Line engine report: Edge fetch number Side Execution report, to which page the user can see which page, the user access to see the results time = home Data read time + home computing time.
2.3 Precautions
The line engine report focuses on performance, by principle we can imagine that for the row engine report, each page of the calculation must be independent, that is, the report can not have cell-related complex operations, similar to the performance of the row engine report, FR discarded some complex features:
The row engine report is only available for single data sources, cell filtering is not available, and must be a simple schedule, and does not support complex reporting functions such as calculations, conditional attributes, and so on.
3. Implementation steps
we take the MySQL database as an example, the s Order Details the data is displayed in a row-based engine with 30 rows per page, set as follows:
3.1 New Data set
Data Set DS1: SELECT * from S Order Details .
3.2 Template Body Design
For example, drag all the columns in the table into the template body:
3.3-ROW Engine Setup
Selecttemplates > Report Engine Properties, Tickexecute a report using a row-style engine, and then check the box belowexecute a report by using a per-page operation segment, the number of records per page uses the default value of 30, such as:
3.4 Effect View
Click the page break preview, the effect is as follows:
row engine fetch by page only applies to Oracle,mysql,hsql and sqlserver2008 and above databases, other databases such as access, SQLSERVER2005, etc. must be manually written paging SQL, in order to achieve per-page fetching, for the need to write paged SQL database, please refer to Single data source implementation Layer report Chapter.
The row engine is only available for single data source reports, and for most data set reports, the row engine is not able to implement pagination display, and the implementation of the multi-source layered report can be viewed Multi-data Set implementation Layer report .
Report performance optimization scenario row engine Execution Layer report