By Clay Li on Wednesday, 20 October 2021
Category: Feature

Auto-Library Selection for Excel Export

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.

2. Samples of Excel Export

The first screenshot is an export with PhpSpreadsheet, the second one is with Spout. 


Additional resources