请选择 进入手机版 | 继续访问电脑版
 找回密码
 立即注册

QQ登录

只需一步,快速开始

liangdf

注册会员

5

主题

21

帖子

52

积分

注册会员

积分
52
liangdf
注册会员   /  发表于:2021-8-14 17:57  /   查看:1934  /  回复:8
本帖最后由 Clark.Pan 于 2021-8-20 17:32 编辑

gcexcel模板使用IF的公式在执行workbook.processTemplate()时就会报错,
请问是这种公式不支持吗,还是写法不对?有替换公式吗?
公式如下:
=IFERROR(IF(OR(AY3="是",AZ3="是",BA3="是"),"是","否"),"否")
=IF(AY3="是","是",IF(AZ3="是","是",IF(BA3="是","是","否")))

报错信息如下:
java.lang.IllegalArgumentException
        at com.grapecity.documents.excel.A.ak.f(Unknown Source)
        at com.grapecity.documents.excel.z.z.a(Unknown Source)
        at com.grapecity.documents.excel.z.z.a(Unknown Source)
        at com.grapecity.documents.excel.z.z.a(Unknown Source)
        at com.grapecity.documents.excel.z.z.a(Unknown Source)
        at com.grapecity.documents.excel.z.z.a(Unknown Source)
        at com.grapecity.documents.excel.C.as.aj(Unknown Source)
        at com.grapecity.documents.excel.Workbook.processTemplate(Unknown Source)
        at com.midea.epm.platform.event.service.impl.CountGcExcelEventServiceImpl.processTemplate(CountGcExcelEventServiceImpl.java:286)
        at com.midea.epm.platform.event.service.impl.CountGcExcelEventServiceImpl.countGcExcelEvent(CountGcExcelEventServiceImpl.java:145)
        at com.midea.epm.platform.event.service.impl.CountGcExcelEventServiceImpl.doButtonEvent(CountGcExcelEventServiceImpl.java:76)
        at com.midea.epm.platform.event.service.impl.CountGcExcelEventServiceImpl$$FastClassBySpringCGLIB$$6cc4d0.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:72)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
        at com.midea.epm.platform.event.service.impl.CountGcExcelEventServiceImpl$$EnhancerBySpringCGLIB$$ef28c7c.doButtonEvent(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:223)
        at com.midea.epm.platform.event.util.ButtonEventUtils.springInvokeExcelButtonEventMethod(ButtonEventUtils.java:46)
        at com.midea.epm.platform.event.service.impl.BudSerialButtonEventServiceImpl.doInnerExcelButtonEventByEventInsId(BudSerialButtonEventServiceImpl.java:291)
        at com.midea.epm.platform.event.service.impl.BudSerialButtonEventServiceImpl$$FastClassBySpringCGLIB$$223f4e49.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:72)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
        at com.midea.epm.platform.event.service.impl.BudSerialButtonEventServiceImpl$$EnhancerBySpringCGLIB$$72ca1ec2.doInnerExcelButtonEventByEventInsId(<generated>)
        at com.midea.epm.platform.controller.BudConfExcelButtonEventController.buttonEventInsExecutor(BudConfExcelButtonEventController.java:620)
        at com.midea.epm.platform.controller.BudConfExcelButtonEventController.buttonEventInsExecutor(BudConfExcelButtonEventController.java:637)
        at com.midea.epm.platform.controller.BudConfExcelButtonEventController.buildEventIns(BudConfExcelButtonEventController.java:494)
        at com.midea.epm.platform.controller.BudConfExcelButtonEventController.listener(BudConfExcelButtonEventController.java:998)
        at com.midea.epm.platform.controller.BudConfExcelButtonEventController$$FastClassBySpringCGLIB$$ee3be9c8.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
        at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
        at org.springframework.aop.interceptor.AsyncExecutionInterceptor$$Lambda$594/1987892955.call(Unknown Source)
        at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
        at java.util.concurrent.FutureTask.run(FutureTask.java)
        at java.lang.Thread.run(Thread.java:745)



评分

参与人数 1金币 +500 收起 理由
Clark.Pan + 500 感谢反馈产品问题

查看全部评分

8 个回复

倒序浏览
Clark.Pan讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-8-16 10:05:16
沙发
本帖最后由 Clark.Pan 于 2022-7-13 15:54 编辑

问题收到,这边正在验证,有结果后会给您回复

---
if公式需要用“==”而不是“=”,GcExcel模板中进一下几种公式支持“=”:"sum","count","average","max","min","product","stddev","stddevp","var","varp".

回复 使用道具 举报
Clark.Pan讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-8-16 14:43:09
板凳
您好,目前模板功能formula这块做得比较初级,只能支持一些简单公式,还不支持这种嵌套引用。这块我已经向研发反馈,问题编号:SJS-9689,后续会慢慢支持这些功能。
该问题做保留处理,有任何进展我会第一时间在这里向您反馈。
回复 使用道具 举报
liangdf
注册会员   /  发表于:2021-8-16 15:18:27
地板
没有替换的公式或方法了吗?遇到这种公式我要怎样处理?
回复 使用道具 举报
Clark.Pan讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-8-16 18:45:37
5#
目前此类公式无法使用模板功能,该功能目前不支持带有嵌套的公式。这个您可以考虑暂时换其他的功能来实现。后面模板功能会进行调整,调整后应该可以对此类嵌套公式进行支持。
回复 使用道具 举报
liangdf
注册会员   /  发表于:2021-9-13 09:19:42
6#
请问这种IF的公式什么时候能支持,不管有没有嵌套公式,凡是有IF的公式都会报错,我们使用上会有很多IF的公式,有没有准确的时间gcexcel工具可以支持IF公式?
回复 使用道具 举报
Clark.Pan讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-9-13 10:19:57
7#
您好:
这个功能我们后来跟研发讨论过,当做一个新的需求去做,我们计划在GcExcel V5版本对模板功能进行增强,该需求会基于模板增强,不出意外V5版本会发布。有任何新的消息,我会在这里第一时间向您回复。
回复 使用道具 举报
liangdf
注册会员   /  发表于:2021-9-13 10:41:16
8#
V5版本什么时候会发布?
回复 使用道具 举报
Derrick.Jiao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2021-9-13 14:44:15
9#
liangdf 发表于 2021-9-13 10:41
V5版本什么时候会发布?

预计在12月中旬发布。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部