zoukankan      html  css  js  c++  java
  • php 导出 Excel 报错 exception 'PHPExcel_Calculation_Exception' with message

    exception 'PHPExcel_Calculation_Exception' with message '粉丝数据!C2679 -> Formula Error: Operator '=' has no operands' in D:wwwczydweixinExtendVendorPHPExcelPHPExcelCell.php:300 Stack trace: #0 D:wwwczydweixinExtendVendorPHPExcelPHPExcelWriterExcel5Worksheet.php(460): PHPExcel_Cell->getCalculatedValue() #1 D:wwwczydweixinExtendVendorPHPExcelPHPExcelWriterExcel5.php(187): PHPExcel_Writer_Excel5_Worksheet->close() #2 D:wwwczydweixinPigCmsLibActionUserWechat_groupAction.class.php(294): PHPExcel_Writer_Excel5->save('php://output') #3 [internal function]: Wechat_groupAction->index() #4 D:wwwczydweixinLibCoreApp.class.php(183): ReflectionMethod->invoke(Object(Wechat_groupAction)) #5 D:wwwczydweixinLibCoreApp.class.php(219): App::exec() #6 D:wwwczydweixinLibCoreThink.class.php(39): App::run() #7 D:wwwczydweixinCommon untime.php(243): Think::start() #8 D:wwwczydweixinindex.php(37): require('D:wwwczydweix...') #9 {main}

    关键点:Error: Operator '=' has no operands'

    导致问题原因可能是导出字段中包含有  ‘=’  ,解决办法:在字段前拼上一个半单引号。

     if(strpos($lists[$i-2]['nickname'],'=') === 0){
                    $lists[$i-2]['nickname'] = "'".$lists[$i-2]['nickname'];
                }

  • 相关阅读:
    游标和视图
    sql server 变量与集合运算
    sql server 流程控制
    sql server 基础查询和子查询
    数据库范式快速理解
    创建数据库与数据表
    SQL server 使用
    Android studio 下载依赖jar包慢
    java根据list数据通过接口姓名并填充
    【翻译】Promises/A+规范
  • 原文地址:https://www.cnblogs.com/yzycoder/p/4997080.html
Copyright © 2011-2022 走看看