In Release R21e of October 2021, Calem will select a library based on the number of rows to export to Excel in reports.
Here is a summary of the differences.
| PhpSpreadsheet | Box/Spout |
Formatting and Styles | Rich | Simple (e.g. lack of column width control) |
Performance | Slow | Fast (half of the time of PhpSpreasheet) |
Memory Usage | Large (for reports of thousands of rows) | Small (3MB) |
1. Library Configuration
A system configuration is available to control when to use the Spout library. If a report has 5000 rows (default configuration) the Spout library is used to generate the excel report. Otherwise, PhpSpreadsheet is used.
Add the following config lines to server/conf/calem.custom.php to tweak the use of Spout.
//Enable spout library $_CALEM_dist['report_conf']['spout_by_row']=true; //Minimum number of rows to use Spout $_CALEM_dist['report_conf']['spout_row_min']=5000; //Optionally exclude report from Spout $_CALEM_dist['report_conf']['spout_by_row_ex']=array( );
2. Samples of Excel Export
The first screenshot is an export with PhpSpreadsheet, the second one is with Spout.
Additional resources
By accepting you will be accessing a service provided by a third-party external to https://eam.calemeam.com/