使用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
时间: 2024-10-02 09:49:57