Пример #1
0
 /**
  * Generates the binary excel data
  * @return string
  * @throws CakeException If the excel writer does not exist
  */
 private function __output()
 {
     $this->PhpExcel->getProperties()->setCreator(Configure::read('App.author'));
     $this->PhpExcel->getProperties()->setDescription('generated by ' . Configure::read('App.title'));
     $this->PhpExcel->getProperties()->setKeywords("office 2007 openxml php");
     ob_start();
     $writer = \PHPExcel_IOFactory::createWriter($this->PhpExcel, 'Excel2007');
     if (!isset($writer)) {
         throw new Exception('Excel writer not found');
     }
     $writer->setPreCalculateFormulas(false);
     $writer->setIncludeCharts(true);
     $writer->save('php://output');
     $output = ob_get_clean();
     return $output;
 }