Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-349

When adding a chart, if selected cells contains errors, spreadsheet throw a runtime exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 3.0.0 RC
    • 3.0.0 RC
    • ZSS Component

      Problem Description:

      When adding a chart, if selected cells contains errors, e.g. #NAME? or #VALUE!, spreadsheet throw a runtime exception. The message is hard to understand.

      [1] Selected cells contains #VALUE!.
      Reproducing steps:

      1. load attached file chart-data.xlsx
      2. select cells from A3 to D6
      3. insert any chart
        • throw exception: "Invalid ValueEval type passed for conversion: (class org.zkoss.poi.ss.formula.eval.NameEval)"

      Stack trace:

      Jun 28, 2013 3:47:55 PM org.zkoss.zk.ui.impl.UiEngineImpl handleError:1359
      SEVERE: >>java.lang.RuntimeException: Invalid ValueEval type passed for conversion: (class org.zkoss.poi.ss.formula.eval.NameEval)
      >>	at org.zkoss.poi.ss.formula.functions.MultiOperandNumericFunction.collectValue(MultiOperandNumericFunction.java:224)
      >>	at org.zkoss.poi.ss.formula.functions.MultiOperandNumericFunction.collectValues(MultiOperandNumericFunction.java:164)
      >>	at org.zkoss.poi.ss.formula.functions.MultiOperandNumericFunction.getNumberArray(MultiOperandNumericFunction.java:129)
      >>	at org.zkoss.poi.ss.formula.functions.MultiOperandNumericFunction.evaluate(MultiOperandNumericFunction.java:91)
      >>	at org.zkoss.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:132)
      >>	at org.zkoss.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:539)
      >>	at org.zkoss.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:316)
      >>	at org.zkoss.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:255)
      >>	at org.zkoss.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluateFormulaCellValue(XSSFFormulaEvaluator.java:267)
      >>	at org.zkoss.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluate(XSSFFormulaEvaluator.java:120)
      >>	at org.zkoss.poi.ss.usermodel.charts.DataSources$AbstractCellRangeDataSource.getCellValueAt(DataSources.java:149)
      >>	at org.zkoss.poi.ss.usermodel.charts.DataSources$1.getPointAt(DataSources.java:44)
      >>	at org.zkoss.poi.ss.usermodel.charts.DataSources$1.getPointAt(DataSources.java:1)
      >>	at org.zkoss.poi.xssf.usermodel.charts.XSSFChartUtil.fillNumCache(XSSFChartUtil.java:123)
      >>	at org.zkoss.poi.xssf.usermodel.charts.XSSFChartUtil.buildNumRef(XSSFChartUtil.java:89)
      >>	at org.zkoss.poi.xssf.usermodel.charts.XSSFChartUtil.buildNumDataSource(XSSFChartUtil.java:80)
      >>	at org.zkoss.poi.xssf.usermodel.charts.XSSFBarChartData$Serie.addToChart(XSSFBarChartData.java:141)
      >>	at org.zkoss.poi.xssf.usermodel.charts.XSSFBarChartData.fillChart(XSSFBarChartData.java:172)
      >>	at org.zkoss.poi.xssf.usermodel.XSSFChart.plot(XSSFChart.java:233)
      >>	at org.zkoss.zssex.model.impl.DrawingManagerImpl.addChartX(DrawingManagerImpl.java:333)
      >>	at org.zkoss.zss.model.sys.impl.XRangeImpl.addChart(XRangeImpl.java:2254)
      >>	at org.zkoss.zss.api.impl.RangeImpl.addChart(RangeImpl.java:754)
      >>	at org.zkoss.zss.api.SheetOperationUtil.addChart(SheetOperationUtil.java:155)
      >>	at org.zkoss.zssex.ui.DefaultExUserActionHandler.doChart(DefaultExUserActionHandler.java:305)
      >>	at org.zkoss.zssex.ui.DefaultExUserActionHandler.doColumnChart(DefaultExUserActionHandler.java:312)
      >>	at org.zkoss.zssex.ui.DefaultExUserActionHandler.dispatchAction(DefaultExUserActionHandler.java:215)
      >>	at org.zkoss.zss.ui.DefaultUserActionHandler.onEvent(DefaultUserActionHandler.java:1387)
      >>	at org.zkoss.zssex.ui.DefaultExUserActionHandler.onEvent(DefaultExUserActionHandler.java:83)
      >>	at org.zkoss.zss.ui.Spreadsheet$3.onEvent(Spreadsheet.java:343)
      >>	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2748)
      >>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2719)
      >>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2660)
      >>	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1717)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1502)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1212)
      >>	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:600)
      >>	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:482)
      >>	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:491)
      >>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      >>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      >>	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      >>	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
      >>	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      >>	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      >>	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
      >>	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
      >>	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      >>	at org.mortbay.jetty.Server.handle(Server.java:326)
      >>	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      >>	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
      >>	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
      >>	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      >>	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      >>	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
      >>	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      

      [2] Selected cells contains #NAME?.
      Reproducing steps:

      1. load attached file chart-data.xlsx
      2. select cells from A7 to D9
      3. insert any chart
        • throw exception: "Unexpected eval class (org.zkoss.poi.ss.formula.eval.NameEval)"

      Stack trace:

      2013/6/19 下午 04:07:30 org.zkoss.zk.ui.impl.UiEngineImpl handleError:1359
      Jun 28, 2013 3:55:02 PM org.zkoss.zk.ui.impl.UiEngineImpl handleError:1359
      SEVERE: >>java.lang.RuntimeException: Unexpected eval class (org.zkoss.poi.ss.formula.eval.NameEval)
      >>	at org.zkoss.poi.xssf.usermodel.XSSFFormulaEvaluator.getCellValueByValueEval(XSSFFormulaEvaluator.java:310)
      >>	at org.zkoss.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluateFormulaCellValue(XSSFFormulaEvaluator.java:268)
      >>	at org.zkoss.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluate(XSSFFormulaEvaluator.java:120)
      >>	at org.zkoss.poi.ss.usermodel.charts.DataSources$AbstractCellRangeDataSource.getCellValueAt(DataSources.java:149)
      >>	at org.zkoss.poi.ss.usermodel.charts.DataSources$1.getPointAt(DataSources.java:44)
      >>	at org.zkoss.poi.ss.usermodel.charts.DataSources$1.getPointAt(DataSources.java:1)
      >>	at org.zkoss.poi.xssf.usermodel.charts.XSSFChartUtil.fillNumCache(XSSFChartUtil.java:123)
      >>	at org.zkoss.poi.xssf.usermodel.charts.XSSFChartUtil.buildNumRef(XSSFChartUtil.java:89)
      >>	at org.zkoss.poi.xssf.usermodel.charts.XSSFChartUtil.buildNumDataSource(XSSFChartUtil.java:80)
      >>	at org.zkoss.poi.xssf.usermodel.charts.XSSFLineChartData$Serie.addToChart(XSSFLineChartData.java:102)
      >>	at org.zkoss.poi.xssf.usermodel.charts.XSSFLineChartData.fillChart(XSSFLineChartData.java:131)
      >>	at org.zkoss.poi.xssf.usermodel.XSSFChart.plot(XSSFChart.java:233)
      >>	at org.zkoss.zssex.model.impl.DrawingManagerImpl.addChartX(DrawingManagerImpl.java:333)
      >>	at org.zkoss.zss.model.sys.impl.XRangeImpl.addChart(XRangeImpl.java:2254)
      >>	at org.zkoss.zss.api.impl.RangeImpl.addChart(RangeImpl.java:754)
      >>	at org.zkoss.zss.api.SheetOperationUtil.addChart(SheetOperationUtil.java:155)
      >>	at org.zkoss.zssex.ui.DefaultExUserActionHandler.doChart(DefaultExUserActionHandler.java:305)
      >>	at org.zkoss.zssex.ui.DefaultExUserActionHandler.doLineChart(DefaultExUserActionHandler.java:320)
      >>	at org.zkoss.zssex.ui.DefaultExUserActionHandler.dispatchAction(DefaultExUserActionHandler.java:219)
      >>	at org.zkoss.zss.ui.DefaultUserActionHandler.onEvent(DefaultUserActionHandler.java:1387)
      >>	at org.zkoss.zssex.ui.DefaultExUserActionHandler.onEvent(DefaultExUserActionHandler.java:83)
      >>	at org.zkoss.zss.ui.Spreadsheet$3.onEvent(Spreadsheet.java:343)
      >>	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2748)
      >>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2719)
      >>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2660)
      >>	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1717)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1502)
      >>	at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1212)
      >>	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:600)
      >>	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:482)
      >>	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:491)
      >>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      >>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      >>	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      >>	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
      >>	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      >>	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      >>	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
      >>	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
      >>	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      >>	at org.mortbay.jetty.Server.handle(Server.java:326)
      >>	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      >>	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
      >>	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
      >>	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      >>	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      >>	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
      >>	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      

      If we insert a chart using those cells in Excel 2007, it will work fine and error cell will be zero:

        1. excel.png
          excel.png
          78 kB
        2. chart-data.xlsx
          10 kB

            paowang paowang
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: