excel export

Questionsexcel export
santosh asked 6 years ago

The export feature only works for small tables
When I try to export a table with more number of rows I see this error

Allowed memory size of 67108864 bytes exhausted (tried to allocate 1024 bytes) in /home/public_html/grids/lib/inc/jqgrid_dist.php on line 1254

4 Answers
santosh answered 6 years ago

I did some further testing and the problem seems to be with number of fields

table with 10 columns is exported successfully

table with 140 columns fails

Abu Ghufran answered 6 years ago


140 columns is quite big number. Perhaps you also need to increase php memory limit in php.ini
I have also sent you alternate excel export lib to test.

santosh answered 6 years ago

I am seeing the same error even with the new lib. I have emailed you the my current code to export to csv and it seems to work with the same memory (however this is csv not excel)

Abu Ghufran answered 6 years ago


You can still use your export file if you wish. Just connect it on_export event.

$e["on_export"] = array("custom_export", null, false);

function custom_export($param)
$sql = $param["sql"]; // the SQL statement for export
$grid = $param["grid"]; // the complete grid object reference

if ($grid->options["export"]["format"] == "xls")
$_SESSION["phpgrid_sql"] = $sql; // you can use it in your export file
else if ($grid->options["export"]["format"] == "pdf")
// your custom pdf generation code goes here …

Your Answer

17 + 15 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!