欢迎来到我的博客

xdocrepor读取resource目录下的word模板报:fr.opensagres.xdocreport.core.XDocReportException: Impossible to create report for the input stream. The report loader supports only [odt,docx] files type.

使用xdocrepor导出的时候模板在服务器读取指定路径是没问题的,但是我想放入自己项目resource目录中,总是报格式不支持错误!

 

 模板是放入项目中,编辑的时候会破坏模板结构,导致模板文件类型不支持

解决办法:

pom文件增加文件过滤(maven ckean后重试)

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
posted @ 2022-08-15 14:51  八千轮回  阅读(2306)  评论(0编辑  收藏  举报
人生三从境界:昨夜西风凋碧树,独上高楼,望尽天涯路。 衣带渐宽终不悔,为伊消得人憔悴。 众里寻他千百度,蓦然回首,那人却在灯火阑珊处。