本文介绍了PHPEXCEL getCalculatedValue或getFormattedValue返回致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MIME类型为"application/octet-stream; charset = binary"且扩展名为".xlsx"的文件. PHPExcel_IOFactory :: identify($ this-> file)返回'Excel2007'.我这样创建我的阅读器:

I have a file with mime-type "application/octet-stream; charset=binary" and extension ".xlsx". PHPExcel_IOFactory::identify($this->file) returns 'Excel2007'. I create my reader like this:

区别在于,应用%格式掩码会在MS Excel中显示实际单元格值乘以100 

In this case, you say it's incorrect..... you're wrong, it is correct: 17.4% is 0.174... the difference is that applying a % format mask displays the actual cell value in MS Excel multiplied by 100

致电时

$sheet->getCell($columns[$i].$row->getRowIndex())->getCalculatedValue()

$sheet->getCell($columns[$i].$row->getRowIndex())->getFormattedValue()

PHPExcel尝试执行该单元格的公式并重新计算该值.如果这引发异常,则可以通过启用计算引擎的调试模式来调试计算引擎,以查看错误原因,如要点

PHPExcel tries to execute the formula for the cell and recalculate the value. If this is throwing an exception, you can debug the calculation engine to see where it is going wrong by enabling the calculation engine's debug mode, as described in this gist

这篇关于PHPEXCEL getCalculatedValue或getFormattedValue返回致命错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 18:43
查看更多