Generated excel has bad format

Hi,

I’m trying to export a grid into an excel, this way:

gridResourceCommissionGeneral.toExcel('codebase/grid-excel-php/generate.php');

Once I try to open the generated grid.xlsx, Excel tells me:

Excel cannot open this file
The file format or file extension is not valid. Verify that the file has nod been corrupted and that the file extension matches the format of the file.

Thanks,
Samuel

I attached the generated file.
grid.xlsx.zip (6.29 KB)

This is the xml I found into error_export_report:



The error number reported is 8.
Hope this could help.

After some tries, I found a little error.
Fixed it the problem is still there, but now the function

function PDFErrorHandler ($errno, $errstr, $errfile, $errline) {
global $xmlString;
if ($errno < 1024) {
$xmlString = $xmlString.’’. $errno." “.$errstr.” “.$errfile.” ".$errline;
error_log($xmlString, 3, 'error_report
’.$errno.’_’.date(“Y_m_d__H_i_s”).’.xml’);
}
}

is not fired.
From the debug part of generate.php file I got this output:


any ideas?

Browsing the forum I found this post:

viewtopic.php?f=23&t=31037&p=97606&hilit=toexcel+bad+format#p97606

downloading the suggested zip, the export works now fine.

Sam

Browsing the forum I found this post:

viewtopic.php?f=23&t=31037&p=97606&hilit=toexcel+bad+format#p97606

downloading the suggested zip, the export works now fine.

Sam