在参考客服给的文档后,再加上自己的一些摸索,找到了可用的方法,记录一下。

环境说明:

  • SpringBoot 2.1.1.RELEASE
  • FineReport 10.0
  • Tomcat 9.0.13
  • java version "1.8.0_192"

集成步骤:

1. 安装jar包。官方文档 嵌入式部署 中指出所有‘fine’开头的jar包都是必须导入的。

call mvn install:install-file -Dfile=fine-accumulator-10.0.jar -DgroupId=com.fine -DartifactId=fine-accumulator -Dversion=10.0 -Dpackaging=jar
call mvn install:install-file -Dfile=fine-activator-10.0.jar -DgroupId=com.fine -DartifactId=fine-activator -Dversion=10.0 -Dpackaging=jar
call mvn install:install-file -Dfile=fine-core-10.0.jar -DgroupId=com.fine -DartifactId=fine-core -Dversion=10.0 -Dpackaging=jar
call mvn install:install-file -Dfile=fine-datasource-10.0.jar -DgroupId=com.fine -DartifactId=fine-datasource -Dversion=10.0 -Dpackaging=jar
call mvn install:install-file -Dfile=fine-decision-10.0.jar -DgroupId=com.fine -DartifactId=fine-decision -Dversion=10.0 -Dpackaging=jar
call mvn install:install-file -Dfile=fine-decision-report-10.0.jar -DgroupId=com.fine -DartifactId=fine-decision-report -Dversion=10.0 -Dpackaging=jar
call mvn install:install-file -Dfile=fine-report-engine-10.0.jar -DgroupId=com.fine -DartifactId=fine-report-engine -Dversion=10.0 -Dpackaging=jar
call mvn install:install-file -Dfile=fine-schedule-10.0.jar -DgroupId=com.fine -DartifactId=fine-schedule -Dversion=10.0 -Dpackaging=jar
call mvn install:install-file -Dfile=fine-schedule-report-10.0.jar -DgroupId=com.fine -DartifactId=fine-schedule-report -Dversion=10.0 -Dpackaging=jar
call mvn install:install-file -Dfile=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=fine-third-10.0.jar -DgroupId=com.fine -DartifactId=fine-third -Dversion=10.0 -Dpackaging=jar
call mvn install:install-file -Dfile=fine-webui-10.0.jar -DgroupId=com.fine -DartifactId=fine-webui -Dversion=10.0 -Dpackaging=jar

2. pom.xml中添加依赖。这里把 fine-swift-log-adaptor 包注释了,因为发现导入这个包后会一直报错,因为暂时用不到就先注释掉,之后再研究。

<!-- FineReport -->
<dependency><groupId>com.fine</groupId><artifactId>fine-accumulator</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.  修改项目的打包方式为 war,禁用集成的 Tomcat

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId><scope>provided</scope>
</dependency>

4. 修改启动类,使启动类继承 SpringBootServletInitializer,添加 @EnableAutoConfiguration 注解,重写 configure方法

@SpringBootApplication
@EnableAutoConfiguration
public class DemoApplication extends SpringBootServletInitializer {public static void main(String[] args) {SpringApplication.run(DemoApplication.class, args);}@Overrideprotected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {return builder.sources(DemoApplication.class);}
}

5. 拷贝tools.jar。详情参考:服务器部署需引入tools.jar。

6. 在src/main下新建 webapps/WEB-INF/reportlets/,将报表放置在此文件夹下。如下图:

7. 配置Tomcat的 Timeouts 设置 。本机上的启动时间是60多秒,所以设置为90秒。如上图:

8. (可选)修改访问路径。修改 server.xml 中的 Context标签的 path 属性为“/”,如下图:

9. 访问路径说明。

  • 如果步骤8不中 path 设置为了 “/”
  1. 数据决策系统的访问路径 http://localhost:8080/decision

  2. 报表的访问路径是 http://localhost:8080/decision/view/report?viewlet=GettingStarted.cpt

  3. 自己项目中controller的访问路径是 http://localhost:8080/web

  • 如果步骤8中未修改 path
  1. 数据决策系统的访问路径 http://localhost:8080/demo/decision
  2. 报表的访问路径是 http://localhost:8080/demo/decision/view/report?viewlet=GettingStarted.cpt
  3. 自己项目中controller的访问路径是 http://localhost:8080/demo/web

SpringBoot2.1.1集成FineReport相关推荐

  1. springboot2.1.5集成finereport10.0过程中:手动安装本地jar包到maven仓库

    springBoot2.1.5集成finereport10.0过程中,pom依赖中需要用到finereport安装路径下的jar包,主要有:以fine开头的jar包 按住Ctrl+Shift在空白位置 ...

  2. SpringBoot2.6.x集成swagger: Failed to start bean ‘documentationPluginsBootstrapper问题解决

    在使用SpringBoot2.6.x集成swagger的时候,启动的时候出现了:Failed to start bean 'documentationPluginsBootstrapper 的空指针异 ...

  3. springboot2.0.5集成mybatis(PageHelper分页插件、generator插件使用)

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/zab635590867/article ...

  4. finereport集成java_JFinal集成Finereport

    FineReport报表软件是一款纯Java编写的.集数据展示(报表)和数据录入(表单)功能于一身的企业级web报表工具,它"专业.简捷.灵活"的特点和无码理念,仅需简单的拖拽操作 ...

  5. springbot集成finereport后在web中使用iframe引用报表

    自己把报表开发好了后,运行地址 http://localhost:8075/webroot/decision/view/report?viewlet=reviewBoard.cpt 运行结果: 想要把 ...

  6. Springboot2.x +JPA 集成 Apache ShardingSphere 分库分表

    分库分表背景: 数据库性能瓶颈:主要分为按照业务来划分或者按照数据量来划分. 拆分方式: 水平拆分(每个表的结构都一样):订单表数据量大,我们可以水平拆分 ,分成order表1.order表2.ord ...

  7. springboot2.3.4集成EhCache缓存框架完整代码

    代码部分 pom <?xml version="1.0" encoding="UTF-8"?> <project xmlns="ht ...

  8. Springboot2.x +JPA 集成 Apache ShardingSphere 分表+读写分离

    分库分表背景: 数据库性能瓶颈:主要分为按照业务来划分或者按照数据量来划分. 拆分方式: 水平拆分(每个表的结构都一样):订单表数据量大,我们可以水平拆分 ,分成order表1.order表2.ord ...

  9. Springboot2.x +JPA 集成 Apache ShardingSphere 读写分离

    分库分表背景: 数据库性能瓶颈:主要分为按照业务来划分或者按照数据量来划分. 拆分方式: 水平拆分(每个表的结构都一样):订单表数据量大,我们可以水平拆分 ,分成order表1.order表2.ord ...

最新文章

  1. luogu P1231 教辅的组成(建图、拆点、最大流)
  2. android adb命令
  3. 041_Popover弹出框
  4. 关于input file img实时预览获取文件路径的问题
  5. win7在未关闭vmware情况下直接关机,导致虚拟机无法克隆
  6. web端功能测试总结(一)
  7. hdu3535 (分组背包,最少选一 + 最多选一 + 随意)
  8. 《SEO的艺术(原书第2版)》——3.11 为意识形态影响力开展SEO
  9. sql 求相交的行_SQL相交
  10. mysql导入access2016_将 Access 2.0 和 Access 95 数据库导入到当前版本
  11. 浅谈 Android Dex 文件
  12. ValueError: Duplicate plugins for name projector
  13. Unity3d Platformer Pro 2D游戏开发框架使用教程
  14. 从零学会Photoshop经典教程300集
  15. SQL Server 的几个故障
  16. shell C语言编程
  17. R代码学习(5)——数据类型(字符串)
  18. 4月4日 JavaWeb 周三
  19. springdata jpa jpql 条件查询
  20. 京东12G用户数据外泄,京东官方承认:源于2013年安全漏洞

热门文章

  1. 多媒体网络的分布式知识要点
  2. 程旭:CPU方寸上的中国信念 --转载
  3. eclipse远程连接Hadoop遇到的一些问题
  4. 史上最全PPT制作教程和PPT模板,毕业论文答辩PPT制作方法
  5. 面试官常问的几个问题
  6. Redis压测工具(redis-benchmark)
  7. w ndows7手写,Windows7使用教程之Tablet PC手写输入
  8. 学术文献翻译改写 F36(含心得)
  9. python 从4399获取小游戏
  10. dz文件cp.php,DZ文件扩展名 - 什么是.dz以及如何打开? - ReviverSoft