KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Export To Excel #1543

Open sevgi opened this topic on on Jul 28, 2020 - 4 comments

sevgi commented on Jul 28, 2020

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/cafm/app/webroot/report/koolreport/core/src/datasources/MySQLDataSource.php on line 418

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/cafm/core/system/funcs/core.php on line 0

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36864 bytes) in Unknown on line 0

David Winterburn commented on Jul 29, 2020

Hi Sevgi,

It's very hard for us to help you to solve problem with only this error message. Next time please post full detail of your data structure, size and your php code. Thanks!

KoolReport commented on Jul 29, 2020

Could you please post some of code to illustrate the case, also may I know the number of row returned from your query. From the error, I only can suggest that you can:

  1. Increase memory size allocated to PHP
  2. Modify the query so that it return only needed information
  3. Use Big Speadsheet to export data to excel.
sevgi commented on Jul 29, 2020

Query rows returning 434361. export.php: $ report-> run () -> exportToXLSX

Table::create(array(
            "dataSource" => $this->dataStore($this->reportName)
                ->only(..),
            "headersExcelStyle" => [
                'CATEGORY1NAME' => [
                    'font' => [
                        'bold' => true,
                    ],
                ]
            ],
        ));
David Winterburn commented on Jul 29, 2020

Hi Sevgi,

434K rows are too big for the default 128MB memory limit of PHP. Please increase both memory_limit (default 128MB) and max_execution_time in your php.ini (default 30 seconds) on your server. Thanks!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Export