PHPExcel runs out of 256, 512 and also 1024MB of RAM

There’s plenty been written about the memory usage of PHPExcel on the PHPExcel forum; so reading through some of those previous discussions might give you a few ideas. PHPExcel holds an “in memory” representation of a spreadsheet, and is susceptible to PHP memory limitations. The physical size of the file is largely irrelevant… it’s much … Read more

Alternative for PHP_excel

For Writing Excel PEAR’s PHP_Excel_Writer (xls only) php_writeexcel from Bettina Attack (xls only) XLS File Generator commercial and xls only Excel Writer for PHP from Sourceforge (spreadsheetML only) Ilia Alshanetsky’s Excel extension now on github (xls and xlsx, and requires commercial libXL component) PHP’s COM extension (requires a COM enabled spreadsheet program such as MS … Read more

PHPExcel — Color part of XLSX table

To colour the rows: $objPHPExcel->getActiveSheet()->getStyle(‘A1000:IV2000’) ->getFill() ->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $objPHPExcel->getActiveSheet()->getStyle(‘A1000:IV2000′) ->getFill() ->getStartColor()->setARGB(PHPExcel_Style_Color::COLOR_BLUE); To format dates: Make sure that you’re setting your date values as an Excel serialized timestamp $myDate = “21/12/2014 15:08:23”; $myDateValue = DateTime::createFromFormat(‘d/m/Y H:i:s’, $myDate); $excelTimeStamp = PHPExcel_Shared_Date::PHPToExcel($myDateValue); $objPHPExcel->getActiveSheet() ->setCellValue(‘A1’, $excelTimeStamp); $objPHPExcel->getActiveSheet() ->getStyle(‘C9’) ->getNumberFormat() ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY); All of this is covered in the documentation and in … Read more