Home  >  Article  >  Backend Development  >  phpexcel读excel有引用部分报错没有找到解决办法

phpexcel读excel有引用部分报错没有找到解决办法

WBOY
WBOYOriginal
2016-06-13 12:15:45778browse

phpexcel读excel有引用部分报错没有找到解决方法
我搜了2天实在是找不到方法解决了,phpexcel手册英文的,不是很看的懂所以也不知道怎么来解决这个问题.
用phpexcel读excel表,我想读取出excel所有工作表内容,然后在保存一个新的excel表.(原因是前excel做的有各种区域保护,还有很多单元做有公式)
问题出在,phpexcel读取某一个工作表中的单元格中的数据,我用的getCalculatedValue()方法,那个单元格做的 "=前面某工作表!A5" 这种公式.phpexcel一读到这种内容就报错,提示为找不到! 感叹符号未知.
下面是报错信息
Fatal error: Uncaught exception 'PHPExcel_Exception' with message '整合一栋楼!C6 -> 整合一栋楼!C5 -> 整合同户型楼层!E29 -> 整合同户型楼层!E25 -> undefined variable '!'' in C:\AppServ\www\4\PHPExcel\Cell.php:308 Stack trace: #0 C:\AppServ\www\4\index.php(86): PHPExcel_Cell->getCalculatedValue() #1 {main} thrown in C:\AppServ\www\4\PHPExcel\Cell.php on line 308

我查phpexcel里面的cell.php源代码,里面好复杂,而且里面做$this的输出直接卡死浏览器

如果改用getValue()函数来做的话,又帮我excel表格里面的公式给读出来了,又没有具体数值部分,就那种一打开excel看到公式的是数值,而不是公式本身.

如果phpexcel不可以,有没有其他的东西可以友好的读取excel里面的数据值,卡这里3天了,实在太累了,一直不能解决
------解决思路----------------------
可以直接 读excel文件 循环出来吧
------解决思路----------------------
获取excel文本内容,通过strip_tags()过滤即可。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn