2.1K Star 9.1K Fork 2.7K

悟耘开源 / easypoi

 / 详情

读取模板文件报错

待办的
任务
创建于  
2024-03-11 20:41

之前没有使用过EasyPoi,尝试用一下,结果: 刚开始的问题1:
The bean 'beanNameViewResolver', defined in class path resource [cn/afterturn/easypoi/configuration/EasyPoiAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class] and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
解决方法:在配置文件中:main.allow-bean-definition-overriding: true 就解决了
需要放在bootstrap中
现在遇见第二个问题:
就是读取模板的时候报错了,
XWPFDocument xwpfDocument = WordExportUtil.exportWord07("C:/Users/admin/Desktop/dd.docx", dataMap);

java.lang.StringIndexOutOfBoundsException: String index out of range: -7
at java.lang.String.substring(String.java:1967)
at cn.afterturn.easypoi.util.PoiPublicUtil.getRealValue(PoiPublicUtil.java:362)
at cn.afterturn.easypoi.word.parse.ParseWord07.changeValues(ParseWord07.java:69)
at cn.afterturn.easypoi.word.parse.ParseWord07.parseThisParagraph(ParseWord07.java:164)
at cn.afterturn.easypoi.word.parse.ParseWord07.parseAllParagraph(ParseWord07.java:123)
at cn.afterturn.easypoi.word.parse.ParseWord07.parseWordSetValue(ParseWord07.java:275)
at cn.afterturn.easypoi.word.parse.ParseWord07.parseWord(ParseWord07.java:231)
at cn.afterturn.easypoi.word.WordExportUtil.exportWord07(WordExportUtil.java:48)
然后就不知道怎么解决了,也没有答案

评论 (0)

mingyuexuan 创建了任务

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(1)
Java
1
https://gitee.com/lemur/easypoi.git
git@gitee.com:lemur/easypoi.git
lemur
easypoi
easypoi

搜索帮助