springcloud集成润乾报表
时间: 2023-11-08 09:05:25 浏览: 52
基于若依Cloud的Jove-Fast微服务项目,可以集成润乾报表。具体步骤如下:
1.在pom.xml文件中添加以下依赖:
```
<dependency>
<groupId>com.runqian</groupId>
<artifactId>report-engine</artifactId>
<version>8.0.10</version>
</dependency>
```
2.在application.yml文件中添加以下配置:
```
ruoyi:
report:
# 润乾报表服务地址
server-url: http://localhost:8888/ReportServer
# 报表文件存放路径
file-path: /data/report
```
3.在代码中调用润乾报表API生成报表。
```
// 获取报表引擎
ReportEngine engine = ReportFactory.getReportEngine();
// 加载报表文件
Report report = engine.loadReportFile("report_file.rpx");
// 设置报表参数
Map<String, Object> params = new HashMap<>();
params.put("param1", "value1");
params.put("param2", "value2");
report.setParameters(params);
// 生成报表
ReportTask task = engine.runReportToHtml(report, new HashMap<>(), new HashMap<>());
String html = task.getContent();
```