KoolReport's Forum

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

Best practice to view and export to Xlsx >100K records from database #2878

Open Mohammad Absi opened this topic on on Nov 20 - 5 comments

Mohammad Absi commented on Nov 20
  • Viewing 100k records take long time and the browser is hanged. paging not solve the issue
  • Export them also return error: Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20971520 bytes)

can you please share with us best practice code to view and export to xls/xlsx >100K records from database

Sebastian Morales commented on Nov 21

Pls send us your php code to see why paging didn't help. As for excel export of huge data, pls consider using Excel package's big spreadsheet export to reduce the amount of memory used, increase php excecution time as well. Rgds,

Mohammad Absi commented on Nov 21

can you please send me your email to share the code with you

Sebastian Morales commented on Nov 22

Here're our emails for support: support@koolreport.com or support@koolphp.net. Rgds,

Mohammad Absi commented on Nov 22

Code sent

Regards,

Sebastian Morales commented on Nov 22

We received your report php code. You used Table widget with its paging but it only supports client-side paging. Thus, all of your data is still loaded to browser. I suggest using datagrid/DataTables widget with its server side paging:

https://www.koolreport.com/docs/datagrid/datatables/#custom-attributes-serverside

With this, only data for the current page is loaded each time.

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
None yet

None