最近,公司采购了帆软的系统,领导安排要与公司的SpringBoot框架进行整合。费了一番牛劲,终于整合成功,下面分享一下我的经验。

  首先,我的开发环境是Intellij IDEA,使用的SpringBoot版本是2.1.1,整合的finereport版本是10.0。

  一、根据帆软官方教程 http://help.finereport.com/ 高级教程->部署集成->服务器部署->报表部署流程->嵌入式部署的介绍,

将%FineReport_HOME%\webapps\webroot\WEB-INF目录下面的assets、assist、classes、embed、lib、plugins、reportlets七个文件夹复制到你的项目的webapp的WEB-INF文件夹下,再将%JAVA_HOME%/jdk/lib下的tools.jar拷贝到你的项目的webapp的WEB-INF的lib文件夹下,如图所示:

   注意,springboot框架默认是不带webapp文件夹以及其子文件夹WEB-INF的,此时需要自己创建这两个文件夹,并将webapp文件夹设置为Web Resource Directory。(通过Project Structure设置)

  二、更改SpringBoot的配置(打包方式/启动方式)

  1.修改pom文件

  (1)修改打包方式为war

  

  (2)修改pom依赖的包,添加servlet依赖,去掉内嵌Tomcat依赖,添加servlet-api依赖:

  

     <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

  2.修改启动文件

  

  3.在idea中设置项目以tomcat方式启动

  (1)

  

  (2)

  

  (3)

  

  点击Fix时,选择第一个即可。

  

  附一张最后的项目结构图:

  

  三、启动程序

  在地址栏中输入http://ip:端口号/项目目录/decision,能成功显示下图页面,则表明SpringBoot集成FineReport成功。

  

  项目源代码链接:

  第一部分:https://download.csdn.net/download/weixin_44299969/10894741

  第二部分:https://download.csdn.net/download/weixin_44299969/10894769

  第三部分:https://download.csdn.net/download/weixin_44299969/10894786

  第四部分:https://download.csdn.net/download/weixin_44299969/10894809

  

  四、补充

  

  1.网上的教程中,有很多介绍将finereport的lib文件做成maven repository的,本人试了试,也可以操作成功,具体操作方法为:

  (1)新建一个bat文件,并将下列的语句复制进去,注意根据你的实际情况修改finereport的jar包的路径,运行这个bat文件,finereport的jar包就会加载到maven的仓库中 

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-accumulator-10.0.jar -DgroupId=com.fine -DartifactId=fine-accumulator -Dversion=10.0 -Dpackaging=jar

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-activator-10.0.jar -DgroupId=com.fine -DartifactId=fine-activator -Dversion=10.0 -Dpackaging=jar

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-core-10.0.jar -DgroupId=com.fine -DartifactId=fine-core -Dversion=10.0 -Dpackaging=jar

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-datasource-10.0.jar -DgroupId=com.fine -DartifactId=fine-datasource -Dversion=10.0 -Dpackaging=jar

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-decision-10.0.jar -DgroupId=com.fine -DartifactId=fine-decision -Dversion=10.0 -Dpackaging=jar

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-decision-report-10.0.jar -DgroupId=com.fine -DartifactId=fine-decision-report -Dversion=10.0 -Dpackaging=jar

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-report-engine-10.0.jar -DgroupId=com.fine -DartifactId=fine-report-engine -Dversion=10.0 -Dpackaging=jar

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-schedule-10.0.jar -DgroupId=com.fine -DartifactId=fine-schedule -Dversion=10.0 -Dpackaging=jar

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-schedule-report-10.0.jar -DgroupId=com.fine -DartifactId=fine-schedule-report -Dversion=10.0 -Dpackaging=jar

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-swift-log-adaptor-10.0.jar -DgroupId=com.fine -DartifactId=fine-swift-log-adaptor -Dversion=10.0 -Dpackaging=jar

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-third-10.0.jar -DgroupId=com.fine -DartifactId=fine-third -Dversion=10.0 -Dpackaging=jar

 call mvn install:install-file -Dfile=E:\programfiles\FineReport_10.0\webapps\webroot\WEB-INF\lib\fine-webui-10.0.jar -DgroupId=com.fine -DartifactId=fine-webui -Dversion=10.0 -Dpackaging=jar

  (2)在pom文件中,添加以下依赖(正文中的依赖不变)

  

 <dependency>
<groupId>com.fine</groupId>
<artifactId>fine-core</artifactId>
<version>10.0</version>
</dependency>
<dependency>
<groupId>com.fine</groupId>
<artifactId>fine-activator</artifactId>
<version>10.0</version>
</dependency>
<dependency>
<groupId>com.fine</groupId>
<artifactId>fine-core</artifactId>
<version>10.0</version>
</dependency>
<dependency>
<groupId>com.fine</groupId>
<artifactId>fine-datasource</artifactId>
<version>10.0</version>
</dependency>
<dependency>
<groupId>com.fine</groupId>
<artifactId>fine-decision</artifactId>
<version>10.0</version>
</dependency>
<dependency>
<groupId>com.fine</groupId>
<artifactId>fine-decision-report</artifactId>
<version>10.0</version>
</dependency>
<dependency>
<groupId>com.fine</groupId>
<artifactId>fine-report-engine</artifactId>
<version>10.0</version>
</dependency>
<dependency>
<groupId>com.fine</groupId>
<artifactId>fine-schedule</artifactId>
<version>10.0</version>
</dependency>
<dependency>
<groupId>com.fine</groupId>
<artifactId>fine-schedule-report</artifactId>
<version>10.0</version>
</dependency>
<dependency>
<groupId>com.fine</groupId>
<artifactId>fine-swift-log-adaptor</artifactId>
<version>10.0</version>
</dependency>
<dependency>
<groupId>com.fine</groupId>
<artifactId>fine-third</artifactId>
<version>10.0</version>
</dependency>
<dependency>
<groupId>com.fine</groupId>
<artifactId>fine-webui</artifactId>
<version>10.0</version>
</dependency>

  (3)此时,正文中第一步的过程中,可以把帆软提供的lib文件中以fine打头的jar包不拷贝到你的项目的webapp中

  

SpringBoot2.1整合finereport10(帆软报表)的更多相关文章

  1. 帆软报表和jeecg的进一步整合--ajax给后台传递map类型的参数

    下面是页面代码: <%@ page language="java" contentType="text/html; charset=UTF-8" page ...

  2. 帆软报表FineReport SQLServer数据库连接失败常见解决方案

    1. 问题描述 帆软报表FineReport客户端连接SQLServer(2000.2005等),常常会出现如下错误:com.microsoft.sqlserver.jdbc.SQLServerExc ...

  3. 帆软报表FineReport中数据连接之Weblogic配置JNDI连接

    1. 制作报表的原理 在帆软报表FineReport设计器中先用JDBC连接到数据库,建立数据库连接,然后用SQL或者其他方法创建数据集,使用数据集制作报表,然后把建立的数据库连接从JDBC连接改成J ...

  4. 帆软报表FineReport中数据连接之Jboss配置JNDI连接

    使用sqlsever 2000数据库数据源来做实例讲解,帆软报表FineReport数据连接中Jboss配置JNDI大概的过程和WEBSPHERE以及WEBLOGIC基本相同,用JDBC连接数据库制作 ...

  5. 帆软报表FineReport中数据连接之Websphere配置JNDI连接

    以oracle9i数据源制作的模板jndi.cpt为例来说明如何在FineReport中的Websphere配置JNDI连接.由于常用服务器的JNDI驱动过大,帆软报表FineReport中没有自带, ...

  6. 帆软报表FineReport中数据连接之Tomcat配置JNDI连接

    1. 问题描述 在帆软报表FineReport中,通过JNDI方式定义数据连接,首先在Tomcat服务器配置好JNDI,然后在设计器中直接调用JNDI的名字,即可成功使用JNDI连接,连接步骤如下: ...

  7. 帆软报表FineReport中数据连接的JDBC连接池属性问题

    连接池原理 在帆软报表FineReport中,连接池主要由三部分组成:连接池的建立.连接池中连接使用的治理.连接池的关闭.下面就着重讨论这三部分及连接池的配置问题. 1. 连接池原理 连接池技术的核心 ...

  8. 帆软报表(finereport)单元格中各颜色标识的含义

    帆软报表(finereport)单元格中,可根据单元格角标的颜色判断单元格进行的操作 过滤:单元格左下角黄色三角形 条件属性:单元格左上角红色三角形.  控件:单元格右侧中间的各种矩形.  左父格:单 ...

  9. 帆软报表(finereport)安装/配置

    1.首先是安装帆软报表软件 下载地址:http://www.finereport.com/product/download           激活码注册格账号就有了 2.启动软件,新建连接数据库 点 ...

  10. JEECG与帆软报表集成

    将FineReport 集成到自己的web项目中,生成报表,可以方便快捷的和自己的项目融合在一起.简化了利用poi的导出遇到的问题. 1.首先在FR中建立好一个模板      例如:我的这张模板是连接 ...

随机推荐

  1. OO第二次作业总结

    OO~第二次作业总结 连续三周的电梯作业结束了,总的来说这三次作业做的还算平稳,既没有被刀,也没有刀中别人.那么接下来开始谈谈我对这三次作业的认识. 一.设计策略 我三次作业的设计思路基本上是相同的, ...

  2. thymeleaf拆分头部(head)显示异常问题

    问题描述: 刚用thymeleaf不久,考虑到公共头部的导入css,js代码,需要拆分. 拆分之后,bootstrap-select下拉多选框出现“样式异常”,本认为是头部拆分问题,css样式未导入成 ...

  3. 转存下链接--- Java awt Swing 进行拖拽实现布局

    http://blog.csdn.net/vpingchangxin/article/details/8673825 swing开发图形界面工具,eclipse swing图形化操作界面工具配置

  4. PHP中逻辑运算符的高效用法---&&和||

    偶尔遇到这个,查了一下,所以就摘录了. 逻辑运算符无非是将值进行逻辑运算.还有其它用法吗?首先让我们先看一下下面的代码,然后我们再一起展开话题.提前给出结论就是(&&)or(||)”这 ...

  5. 通过sqoop将hdfs数据导入MySQL

    简介:Sqoop是一款开源的工具,主要用于在Hadoop(Hive)与传统的数据库(mysql.postgresql...)间进行数据的传递,可以将一个关系型数据库(例如 : MySQL ,Oracl ...

  6. JAVA 8 主要新特性 ----------------(七)新时间日期 API -----Instant 时间戳

    一.简介 用于“时间戳”的运算.它是以Unix元年(传统 的设定为UTC时区1970年1月1日午夜时分)开始 所经历的描述进行运算 二.文档介绍 1.now Instant instantNow = ...

  7. table增删改查操作--jq

    <!doctype html> <html> <head> <meta charset="utf-8"> <title> ...

  8. asp.net 抽象方法和虚方法的用法区别,用Global类重写Application_BeginRequest等方法为例子

    不废话,直接贴代码 public abstract class LogNetGlobal : System.Web.HttpApplication { protected void Applicati ...

  9. Shell的特殊变量

    在Shell里存在的一些特殊变量:$!.$@.$#.$$.$*.$0.$n.$_.$? [root@shell ~]# sh shell.sh aaa bbb ccc$0 获取当前执行的shell脚本 ...

  10. redis_字典_哈希hash

    字典.哈希表基本数据结构 redis字典使用哈希表作为底层实现,基本结构就是数组+散列 typedef struct dictht { // 哈希表数组 dictEntry **table; // 哈 ...