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
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
Hello,
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.
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)
Hello,
You can still use your export file if you wish. Just connect it on_export event.
$e["on_export"] = array("custom_export", null, false);
$g->set_events($e);
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
header("your-file.php");
die;
}
else if ($grid->options["export"]["format"] == "pdf")
{
// your custom pdf generation code goes here …
}
}