PHPExcel SUM 返回0

使用PHPExcel 导出Excel最后的代码是:

$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel2007');
//force user to download the Excel file without writing it to server's HD
$objWriter->save('php://output');

 导出的Excel的"=SUM(A1:A10)"的和还是0,解决方法是在"$objWriter->save('php://output');"之前添加"$objWriter->setPreCalculateFormulas(true);"

 

参考: PhpExcel SUM() returning 0

posted @ 2017-05-17 22:29  五毛钱的饼  阅读(584)  评论(0编辑  收藏  举报