Mar 7, 2013 at 9:58 AM
Edited Mar 7, 2013 at 11:03 AM
Since the last time, I tried to include this code into the CakePHP framework (which I'm currently using) but the Excel file generated is corrupted as if there was unexpected character before the encoding of the XLS.
After some researchs, I found that the framework insert a space before printing the view I want. That space corrupts my excel file.
Actually, when I delete this first space with notepad, I'm then able to open and read the Excel file I just downloaded...
I didn't find a way to prevent CakePHP print this space, thus I try to delete it manually before sending out the XLS file.
Is there a way to display the string generated by the
$objWriter = PHPExcel_IOFactory::createWriter($phpExcel, "Excel5");
If yes, I could delete the first character and then send the file without any issue !
Thanks a lot for your help :]
Edit : I just realized my method is not good... The XLS encoding generated by PHPExcel is good. It is what CakePHP adds that generates my issue... I'll try to find a solution on CakePHP's forums.