title: Write a million records into an Excel
body: <p>I tried to write data into excel with a million record using phpExcel. but it take too much time.</p>
  
  <pre> <code>
  
      $header=array('test1','test1','test1','test1','test1','test1','test1','test1');
      <br>$objPHPExcel = new PHPExcel();
      <br>    // Set document properties
       <br>   $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
                                       ->setLastModifiedBy("Maarten Balliauw")
                                       ->setTitle("Office 2007 XLSX Test Document")
                                       ->setSubject("Office 2007 XLSX Test Document")
                                       ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
                                       ->setKeywords("office 2007 openxml php")
                                       ->setCategory("Test result file");
  
       <br>$objPHPExcel->getActiveSheet()->fromArray($header,NULL,'A1');  
       <br>$sheet = $objPHPExcel->getActiveSheet();  
      <br>// $final_xls_data1 is set of small records
      // $rowcount this variable is set of old rowcounts and set <br>$rowcount=$rowcount +1.
      <br>// create 8 small set of records. then add array in excel object
      $sheet->fromArray($final_xls_data1,NULL,'A'.$rowcount);
  
      $objPHPExcel->getActiveSheet()->setTitle('Simple');
  
          $objPHPExcel->setActiveSheetIndex(0);  
      header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
          header('Content-Disposition: attachment;filename="01simple.xlsx"');
          header('Cache-Control: max-age=0');
          header('Cache-Control: max-age=1');
          header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
          header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified
          header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
          header ('Pragma: public'); // HTTP/1.0
  
          $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
          $objWriter->save($xls_file_path);
  
  </code></pre>
  
  <p>How can I do this?</p>