开发者

PHPExcel - Can it write row by row as fetching from DB

开发者 https://www.devze.com 2023-03-14 20:50 出处:网络
I am using PHPexcel for excel generation. for() { $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $ex_row, $value);

I am using PHPexcel for excel generation.

 for()
    {

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

    $objWriter = PHPExcel_IOFac开发者_C百科tory::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?


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...

0

精彩评论

暂无评论...
验证码 换一张
取 消