>本章介绍springboot如何集成积木报表 1、新建springboot项目(采用idea) ![](https://img.kancloud.cn/14/78/14785894c3627196c9d94e41de1f1ad3_1083x847.png) 点击next,最后点击finsh ![](https://img.kancloud.cn/ba/8c/ba8ce394e414095abd9515071e0b6a2a_1094x848.png) 创建完成之后的项目结构 ![](https://img.kancloud.cn/ac/9f/ac9f94abdd7f775dc2b107852fed2963_512x304.png) 2、执行初始化脚本`积木报表sql` [jimureport.sql](https://github.com/zhangdaiscott/JimuReport/blob/master/db "jimureport.sql") 3、pom文件中引入对应的依赖 ``` <properties> <!-- jdk版本号--> <java.version>1.8</java.version> <!-- DB驱动 --> <postgresql.version>42.2.6</postgresql.version> <ojdbc6.version>11.2.0.3</ojdbc6.version> <sqljdbc4.version>4.0</sqljdbc4.version> <mysql-connector-java.version>5.1.14</mysql-connector-java.version> <minio.version>8.0.3</minio.version> </properties> <!-- 配置远程仓库--> <repositories> <repository> <id>aliyun</id> <name>aliyun Repository</name> <url>https://maven.aliyun.com/repository/public</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>jeecg</id> <name>jeecg Repository</name> <url>https://maven.jeecg.org/nexus/content/repositories/jeecg</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <dependencies> <!--web--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!--freemarker--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-freemarker</artifactId> </dependency> <!-- minio oss--> <dependency> <groupId>io.minio</groupId> <artifactId>minio</artifactId> <version>${minio.version}</version> <optional>true</optional> </dependency> <!-- JimuReport --> <dependency> <groupId>org.jeecgframework.jimureport</groupId> <artifactId>jimureport-spring-boot-starter</artifactId> <version>1.7.4</version> </dependency> <!-- 数据库驱动 --> <!--mysql--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.20</version> <optional>true</optional> <scope>runtime</scope> </dependency> <!-- sqlserver--> <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc4</artifactId> <version>${sqljdbc4.version}</version> <scope>runtime</scope> </dependency> <!-- oracle驱动 --> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>${ojdbc6.version}</version> <scope>runtime</scope> </dependency> <!-- postgresql驱动 --> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>${postgresql.version}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <optional>true</optional> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> ``` ![](https://img.kancloud.cn/ed/f0/edf04a0fb96bbdb395a3d149665afc79_475x569.png) 4、yml配置数据源等信息 ``` server: port: 9000 spring: #配置静态资源 mvc: static-path-pattern: /** resource: static-locations: classpath:/static/ #配置数据库 datasource: url: jdbc:mysql://127.0.0.1:3306/jimureport?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai username: root password: root driver-class-name: com.mysql.cj.jdbc.Driver #JimuReport[minidao配置] minidao : base-package: org.jeecg.modules.jmreport.desreport.dao* db-type: mysql #JimuReport[上传配置] jeecg : jmreport: # 自动保存 autoSave: true # 单位毫秒 默认5*60*1000 interval: 10000 # local|minio|alioss uploadType: local # local path : #文件路径 upload: D:\images # alioss oss: endpoint: oss-cn-beijing.aliyuncs.com accessKey: ?? secretKey: ?? staticDomain: ?? bucketName: ?? # minio minio: minio_url: http://minio.jeecg.com minio_name: ?? minio_pass: ?? bucketName: ?? #输出sql日志 logging: level: org.jeecg.modules.jmreport : debug ``` ![](https://img.kancloud.cn/89/c5/89c595745368b03ee6569a500acc4167_478x648.png) 5、启动类配置扫描包路径 ``` @SpringBootApplication(scanBasePackages = {"org.jeecg.modules.jmreport","com.jimureport.demo"}) ``` ![](https://img.kancloud.cn/8a/b1/8ab1d2247610d86b6a7eda0a7e0c203a_1835x794.png) 6、预览页面 [http://localhost:9000/jmreport/list](http://localhost:9000/jmreport/list) ![](https://img.kancloud.cn/96/d2/96d26dcac99ff517fc5d2385c0c86a69_1913x826.png)