Export to excel not working in demo code on my host

QuestionsExport to excel not working in demo code on my host
Rob asked 3 years ago

When I click the export button I get this

Firefox can’t find the file at http://pdmhs.co.uk/dbtest/demos/export/export-excel.php?grid_id=list1&export=1&jqgrid_page=1&export_type=&sidx=id&sord=desc&rows=20.

and an empty file is created on the server with a name like phpxltmpKlRBee

Changing to export CSV instead of xls works OK

As the same demo code at phpgrid.org works OK I guess this is some kind of configuration issue, any ideas?
I'm on PHP 7.1.3 and using MySQLi and https, PHP grid is Vsn 2.0

I suppose CSV is an acceptable alternative for now as it will import to Excel

4 Answers
Abu Ghufran answered 3 years ago

Seems to be memort limitation of php.
Try increasing php.ini's memory_limit param.

Pavel answered 3 years ago

Got same issue with PHP 7.0. Increasing memory_limit to 512M didn't help. But downgrading to PHP 5.6 resolved the issue, works even with memory_limit=90M. But I wouldn't downgrade only because of this problem, any ideas of possible cause?

Abu Ghufran answered 3 years ago

Can you check php error log file for any error message, when using on php7 ?
This will give some direction about resolution. Blank page could be due to many reasons.

If the error message is not clear, email me grid code + test database sql file + error message.

Pavel answered 3 years ago

Abu, the error was unclear:
[Fri Jul 14 18:35:18 2017] [error] [client] [index.php:19] Base->run(), referer: https://…/phpgrid/demos/export/export-all.php

I replaced PHPExcel class with the last version (1.8.1) and now the export works in PHP 7 as well. Thank you.

Your Answer

17 + 12 =

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!