I. Overview
1) When using FineReport, you may encounter the problem of taking extremely long time to load a report.
2) This article summarizes 7 typical problems and provide solutions to improve the loading speed correspondingly. In some examples, system logs are used to show how the loading speed is improved.
II. Set the system log level
1. The administrator login the decision-making platform
1) Go to [Manage] > [Intelligent Operations] > [Platform Log].
2) Change the system log level to INFO and click [Save].
III. Typical problems and solutions
1. Add widgets in the report to import Excel
If you add widgets in a report to import Excel, the importing process will be slow.
Solution with better performance: Not add widgets in a report to import Excel1) Add a tool for importing Excel
2) Click Data Entry Preview and import an Excel.
3) Check the log. The process spends 10 ms.
1) Add widgets in the report to import Excel.
2) Select Data Entry Preview and import the same Excel file.
3) View the log. The time cost is extended to 36 ms.
Note
After adding widgets, the time used to import Excel is longer. If the report is complex and more widgets are included, more time will be required.
Nevertheless, adding widgets enable you to modify data after loading Excel, so you can ensure the data is accurate before submitting the data to database.
You should choose the optimal solution according to the usage scenario.
2. Use SELECT * to read unused fields when creating datasets
Use SELECT * will impact the executing performance to a degree of 20 - 30%.
Solution with better performance: Specify the felds to use in SQL statementsNote
When creating DB Query datasets, try to take only the fields you need to use and prevent to use SELET * for tables with large numbers of fields.
3. Not create index for database tables to query
When creating datasets by database query, if the table to be queried is assigned with index, the querying speed can be significantly improved comparing to the tables without index.
4. Use filters too often
When creating datasets, using WHERE statements to filter data in advance can improve the executing efficiency comparing to setting filters after the datasets are created.
Solution with better performance: Use WHERE statement to filter data1) Filter data using WHERE statement.
2) Preview and see the log. It takes 2 ms to execute.
1) Remove the WHERE statement in the DB Query.
2) Set a condition for filter: SEX Equal to Male.
3) Preview and see the log. The time for execution extended to 10 ms.
5. Set too much conditional formatting
Some conditional formatting can be applied to the whole row/column, so you only need to set a conditional formatting for one cell in a row/column rather than set one for each cell, otherwise, the same conditional formatting will be executed for several times.
Solution with better performance: Set conditional formatting for one cell in a row and set the applicable range as current row1) Set a conditional formatting for one cell to change the font color as red. Set the applicable range as Current Row.
2) Preview
3) View the log. It takes 13 ms to execute.
1) Set the same conditional formatting for each cell in the row. Change the applicable range to Current Cell.
2) Preview.
3) See the log and the time for execution is extended to 24 ms.
6. Add too much widgets in a report
Loading widgets takes a lot of time when loading a report. Therefore, try to minimize the number of widgets when designing a report. If a number of widgets are required, you can let the system to not display widgets directly.
Solution with better performance: Not display widgets directly1) Add text widgets
2) Set the WEB Attributes. Select [Data Entry] and not check [Display Widgets Directly].
3) Data Entry Preview.
4) View the log. It takes 9 ms to load the report.
1) Check [Display Widgets Directly].
2) Data Entry Preview.
3) See the log. The time to load the report is extended to 44 ms.
7. Rely too much on FineReport to process data
With FineReport, you can process data conveniently. However, if you let FineReport to complete all computations, filters and other operations, the efficiency is poor than completing these operations in database. This is because processing large volume of data will occupy the designer's memory. Differently, mainstream databases have embedded optimization algorithms, so they can process data efficiently.
To conclude, let the databases to complete the data pre-processing while let FineReport to do the work it is good at, the execution efficiency can be significantly improved.