Closed bigliangcong closed 6 years ago
这是因为当前H11取到的值有两个,这两个值默认会以逗号分隔的字符串返回,所以导致转换为数字时报错。 究其原因还是要理解父格的概念,确保取到的H11单元格的值为一个,这样就对了。
发件人:高杰 notifications@github.com 发送时间:2018年8月3日(星期五) 11:00 收件人:youseries/ureport ureport@noreply.github.com 抄 送:梁聪 liangcong@z-try.com; Author author@noreply.github.com 主 题:Re: [youseries/ureport] 表达式正确,报出异常com.bstek.ureport.exception.ConvertException: Can not convert [18000, 18000] to BigDecimal. (#346)
这是因为当前H11取到的值有两个,这两个值默认会以逗号分隔的字符串返回,所以导致转换为数字时报错。 究其原因还是要理解父格的概念,确保取到的H11单元格的值为一个,这样就对了。 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
为了您的问题能得到及时准确解答,请认真填写下面各个选项,感谢您的配合。
当前使用的UReport的具体版本号:2.2.8
遇到的问题描述:我数据库字段为number类型,然后在表格中计算,报出异常。
涉及到的异常信息(完整异常信息):com.bstek.ureport.exception.ConvertException: Can not convert [18000, 18000] to BigDecimal.
at com.bstek.ureport.Utils.toBigDecimal(Utils.java:206) at com.bstek.ureport.utils.ArithUtils.sub(ArithUtils.java:50) at com.bstek.ureport.utils.ElCalculator.calculate(ElCalculator.java:195) at com.bstek.ureport.utils.ElCalculator.calculate(ElCalculator.java:97) at com.bstek.ureport.utils.ElCalculator.eval(ElCalculator.java:39) at com.bstek.ureport.build.Context.evalExpr(Context.java:271) at com.bstek.ureport.expression.model.expr.JoinExpression.compute(JoinExpression.java:101) at com.bstek.ureport.expression.model.expr.JoinExpression.compute(JoinExpression.java:46) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.expression.model.expr.ifelse.ElseExpression.compute(ElseExpression.java:33) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.expression.model.expr.ifelse.IfExpression.compute(IfExpression.java:53) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.build.compute.ExpressionValueCompute.compute(ExpressionValueCompute.java:60) at com.bstek.ureport.build.DataCompute.buildCellData(DataCompute.java:63) at com.bstek.ureport.build.Context.buildCellData(Context.java:146) at com.bstek.ureport.build.ReportBuilder.buildCell(ReportBuilder.java:100) at com.bstek.ureport.Utils.fetchTargetCells(Utils.java:85) at com.bstek.ureport.expression.model.expr.set.CellExpression.compute(CellExpression.java:48) at com.bstek.ureport.expression.model.expr.JoinExpression.compute(JoinExpression.java:46) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.expression.model.expr.ifelse.ExpressionCondition.eval(ExpressionCondition.java:47) at com.bstek.ureport.expression.model.expr.ifelse.ExpressionConditionList.eval(ExpressionConditionList.java:41) at com.bstek.ureport.expression.model.expr.ifelse.IfExpression.compute(IfExpression.java:40) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.build.compute.ExpressionValueCompute.compute(ExpressionValueCompute.java:60) at com.bstek.ureport.build.DataCompute.buildCellData(DataCompute.java:63) at com.bstek.ureport.build.Context.buildCellData(Context.java:146) at com.bstek.ureport.build.ReportBuilder.buildCell(ReportBuilder.java:100) at com.bstek.ureport.Utils.fetchTargetCells(Utils.java:85) at com.bstek.ureport.expression.model.expr.set.CellExpression.compute(CellExpression.java:48) at com.bstek.ureport.expression.model.expr.JoinExpression.compute(JoinExpression.java:46) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.expression.model.expr.ifelse.ExpressionCondition.eval(ExpressionCondition.java:47) at com.bstek.ureport.expression.model.expr.ifelse.ExpressionConditionList.eval(ExpressionConditionList.java:41) at com.bstek.ureport.expression.model.expr.ifelse.IfExpression.compute(IfExpression.java:40) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.build.compute.ExpressionValueCompute.compute(ExpressionValueCompute.java:60) at com.bstek.ureport.build.DataCompute.buildCellData(DataCompute.java:63) at com.bstek.ureport.build.Context.buildCellData(Context.java:146) at com.bstek.ureport.build.ReportBuilder.buildCell(ReportBuilder.java:100) at com.bstek.ureport.Utils.fetchTargetCells(Utils.java:85) at com.bstek.ureport.expression.model.expr.set.CellExpression.compute(CellExpression.java:48) at com.bstek.ureport.expression.model.expr.JoinExpression.compute(JoinExpression.java:46) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.expression.model.expr.ifelse.ExpressionCondition.eval(ExpressionCondition.java:47) at com.bstek.ureport.expression.model.expr.ifelse.ExpressionConditionList.eval(ExpressionConditionList.java:41) at com.bstek.ureport.expression.model.expr.ifelse.IfExpression.compute(IfExpression.java:40) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.build.compute.ExpressionValueCompute.compute(ExpressionValueCompute.java:60) at com.bstek.ureport.build.DataCompute.buildCellData(DataCompute.java:63) at com.bstek.ureport.build.Context.buildCellData(Context.java:146) at com.bstek.ureport.build.ReportBuilder.buildCell(ReportBuilder.java:100) at com.bstek.ureport.Utils.fetchTargetCells(Utils.java:85) at com.bstek.ureport.expression.model.expr.set.CellExpression.compute(CellExpression.java:48) at com.bstek.ureport.expression.model.expr.JoinExpression.compute(JoinExpression.java:46) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.expression.model.expr.ifelse.ExpressionCondition.eval(ExpressionCondition.java:47) at com.bstek.ureport.expression.model.expr.ifelse.ExpressionConditionList.eval(ExpressionConditionList.java:41) at com.bstek.ureport.expression.model.expr.ifelse.IfExpression.compute(IfExpression.java:40) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.build.compute.ExpressionValueCompute.compute(ExpressionValueCompute.java:60) at com.bstek.ureport.build.DataCompute.buildCellData(DataCompute.java:63) at com.bstek.ureport.build.Context.buildCellData(Context.java:146) at com.bstek.ureport.build.ReportBuilder.buildCell(ReportBuilder.java:100) at com.bstek.ureport.Utils.fetchTargetCells(Utils.java:85) at com.bstek.ureport.expression.model.expr.set.CellExpression.compute(CellExpression.java:48) at com.bstek.ureport.expression.model.expr.JoinExpression.compute(JoinExpression.java:46) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.expression.model.expr.ifelse.ExpressionCondition.eval(ExpressionCondition.java:47) at com.bstek.ureport.expression.model.expr.ifelse.ExpressionConditionList.eval(ExpressionConditionList.java:41) at com.bstek.ureport.expression.model.expr.ifelse.IfExpression.compute(IfExpression.java:40) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.build.compute.ExpressionValueCompute.compute(ExpressionValueCompute.java:60) at com.bstek.ureport.build.DataCompute.buildCellData(DataCompute.java:63) at com.bstek.ureport.build.Context.buildCellData(Context.java:146) at com.bstek.ureport.build.ReportBuilder.buildCell(ReportBuilder.java:100) at com.bstek.ureport.Utils.fetchTargetCells(Utils.java:85) at com.bstek.ureport.expression.model.expr.set.CellExpression.compute(CellExpression.java:48) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.expression.model.expr.FunctionExpression.compute(FunctionExpression.java:57) at com.bstek.ureport.expression.model.expr.JoinExpression.compute(JoinExpression.java:46) at com.bstek.ureport.expression.model.expr.BaseExpression.execute(BaseExpression.java:37) at com.bstek.ureport.build.compute.ExpressionValueCompute.compute(ExpressionValueCompute.java:60) at com.bstek.ureport.build.DataCompute.buildCellData(DataCompute.java:63) at com.bstek.ureport.build.Context.buildCellData(Context.java:146) at com.bstek.ureport.build.ReportBuilder.buildCell(ReportBuilder.java:100) at com.bstek.ureport.build.ReportBuilder.buildReport(ReportBuilder.java:81) at com.bstek.ureport.console.html.HtmlPreviewServletAction.loadReport(HtmlPreviewServletAction.java:279) at com.bstek.ureport.console.html.HtmlPreviewServletAction.execute(HtmlPreviewServletAction.java:78) at com.bstek.ureport.console.UReportServlet.service(UReportServlet.java:81) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
相关截图: