4
votes

I am using PHPexcel for excel generation.

 for()
    {

    $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $ex_row, $value);  
   }

    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');

I having huge data result of more than 60000 records with 60 columns.

I think PHPExcel is setting values and everything saved in object array and at last its writing to the file. As PHP is not good with arrays and data is huge am getting request time out error. To avoid that am planning to write row by row. Is it possible that I can write row by row to the excel file and save it at the end?

1
PHPexcel is notorious for slow performance on large datasets. - John Cartwright
Is Excel really a requirement, or will Excel-compatible work? If so, then what about CSV? - cwallenpoole
@cwallen The real issue is Microsoft. we are using csv now. works fine. as people update to msexcel 2007 they getting an warning alert message on opening csv. really useless - zod

1 Answers

0
votes

If the speed of the creation isn't the real problem and the fact that PHP is giving you a timeout error, you could always place this at the top of your script:

set_time_limit(0);

The 0 will allow the script to run and run and run...