ureport2升级到2.3.0

随笔2个月前发布
19 0 0

ureport2是一款功能很强大的中国式报表插件。
它常用的版本是2.2.9,但此版本存在一个bug: 有时要配置特定的单元格风格,如隐藏、改变背景等时,这时在条件属性下配置条件中输入表达式条件后,再次打开模板后会发现中间的运算符变为了undefined,由此造成表格预览失败。
如这里: 发现了uroport工具的一个bug,还不知道如何解决_ureport2 条件配置 undifined-CSDN博客

在github上也有网友报告了这个问题,并且作者也回答说在2.3.0-SNAPSHOT版本中更新了。但在github上最终版本就是2.2.9
在单元格条件属性中配置的操作符再次打开报表后变成undefined · Issue #350 · youseries/ureport · GitHub

最终在gitee上找到了作者放出来的2.3.0-SNAPSHOT版本:ureport: UReport2是一款高性能的Java报表引擎,提供完善的基于网页的报表设计器,可快速做出各种复杂的中式报表 (gitee.com)

将其下载到本地后,导入到idea中重新编译。编译时要注意几点:
1、将idea的本地仓库目录设置为和自己项目相同位置,方便后面升级版本;
2、pom.xml文件中,因为ureport2是五年前的项目了,要将maven-compiler-plugin下插件版本提高到和你现在用的一致,还有jdk的版本

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>utf-8</encoding>
                </configuration>
</plugin>

3、注释掉issueManagement

<!--<issueManagement>
        <url>${jira.browse.url}/VELOCITY</url>
</issueManagement>-->

4、编译时如果提示“Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (sign-artifacts) on project ureport2-core: Exit code: 1”错误,就将此插件注释掉

<!--<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
</plugin>       -->

5、将几个模块都编译完成后,转到之前引用ureport2的项目的pom.xml文件,修改ureport2版本号

 <!--  ureport报表设计器 -->
        <dependency>
            <groupId>com.bstek.ureport</groupId>
            <artifactId>ureport2-console</artifactId>
            <version>2.3.0-SNAPSHOT</version>
        </dependency>

© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...