Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_41234584
spring-boot-demo
提交
f1655d72
S
spring-boot-demo
项目概览
qq_41234584
/
spring-boot-demo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-boot-demo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f1655d72
编写于
10月 26, 2020
作者:
不合群的混子
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
🚧
ureport2 正在进行中
上级
45bcd495
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
168 addition
and
41 deletion
+168
-41
demo-ureport2/README.md
demo-ureport2/README.md
+53
-0
demo-ureport2/pom.xml
demo-ureport2/pom.xml
+65
-41
demo-ureport2/src/main/java/com/xkcoding/ureport2/config/InnerDatasource.java
...in/java/com/xkcoding/ureport2/config/InnerDatasource.java
+34
-0
demo-ureport2/src/main/resources/application.properties
demo-ureport2/src/main/resources/application.properties
+0
-0
demo-ureport2/src/main/resources/application.yml
demo-ureport2/src/main/resources/application.yml
+16
-0
未找到文件。
demo-ureport2/README.md
0 → 100644
浏览文件 @
f1655d72
UReport2 是一款基于架构在 Spring 之上纯 Java 的高性能报表引擎,通过迭代单元格可以实现任意复杂的中国式报表。 在 UReport2 中,提供了全新的基于网页的报表设计器,可以在 Chrome、Firefox、Edge 等各种主流浏览器运行(IE 浏览器除外)。使用 UReport2,打开浏览器即可完成各种复杂报表的设计制作
[
https://www.w3cschool.cn/ureport
](
https://www.w3cschool.cn/ureport
)
## 单机使用
-
1. 引入 jar 依赖
```
xml
<dependency>
<groupId>
com.pig4cloud.plugin
</groupId>
<artifactId>
ureport-spring-boot-starter
</artifactId>
<version>
0.0.1
</version>
</dependency>
```
-
application.properties 配置本地文件保存路径
```
properties
ureport.debug
=
false
ureport.disableFileProvider
=
false
ureport.fileStoreDir
=
/Users/lengleng/Downloads
ureport.disableHttpSessionReportCache
=
true
```
-
访问 报表设计器
http://127.0.0.1:8080/ureport/designer
## 集群使用
如上文设计好的模板是保存在服务本机的,在集群环境中需要使用统一的文件系统存储。新增依赖
```
xml
<dependency>
<groupId>
com.pig4cloud.plugin
</groupId>
<artifactId>
oss-spring-boot-starter
</artifactId>
<version>
0.0.3
</version>
</dependency>
```
-
仅需配置云存储相关参数, 演示为minio
```
oss.access-key=lengleng
oss.secret-key=lengleng
oss.bucket-name=lengleng
oss.endpoint=http://minio.pig4cloud.com
```
关于
[
oss-spring-boot-starter
](
https://github.com/pig-mesh/oss-spring-boot-starter
)
使用可参考,兼容所有 S3 协议的分布式文件存储系统
关于
[
ureport-spring-boot-starter
](
https://github.com/pig-mesh/ureport-spring-boot-starter
)
使用可参考,UReport2 的 spring boot 封装
demo-ureport2/pom.xml
浏览文件 @
f1655d72
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
demo-ureport2
</artifactId>
<artifactId>
demo-ureport2
</artifactId>
<version>
1.0.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<name>
demo-ureport2
</name>
<description>
Demo project for Spring Boot
</description>
<parent>
<groupId>
com.xkcoding
</groupId>
<artifactId>
spring-boot-demo
</artifactId>
<version>
1.0.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<name>
demo-ureport2
</name>
<description>
Demo project for Spring Boot
</description>
<parent>
<groupId>
com.xkcoding
</groupId>
<artifactId>
spring-boot-demo
</artifactId>
<version>
1.0.0-SNAPSHOT
</version>
</parent>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<finalName>
demo-ureport2
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</parent>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<!--web 依赖-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<!--ureport 依赖-->
<dependency>
<groupId>
com.pig4cloud.plugin
</groupId>
<artifactId>
ureport-spring-boot-starter
</artifactId>
<version>
0.0.1
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<optional>
true
</optional>
</dependency>
</dependencies>
<build>
<finalName>
demo-ureport2
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
demo-ureport2/src/main/java/com/xkcoding/ureport2/config/InnerDatasource.java
0 → 100644
浏览文件 @
f1655d72
package
com.xkcoding.ureport2.config
;
import
com.bstek.ureport.definition.datasource.BuildinDatasource
;
import
lombok.SneakyThrows
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.sql.DataSource
;
import
java.sql.Connection
;
/**
* <p>
* 内部数据源
* </p>
*
* @author yangkai.shen
* @date Created in 2020-10-26 22:32
*/
@Component
public
class
InnerDatasource
implements
BuildinDatasource
{
@Autowired
private
DataSource
datasource
;
@Override
public
String
name
()
{
return
"内部数据源"
;
}
@SneakyThrows
@Override
public
Connection
getConnection
()
{
return
datasource
.
getConnection
();
}
}
demo-ureport2/src/main/resources/application.properties
已删除
100644 → 0
浏览文件 @
45bcd495
demo-ureport2/src/main/resources/application.yml
0 → 100644
浏览文件 @
f1655d72
server
:
port
:
8080
servlet
:
context-path
:
/demo
spring
:
datasource
:
url
:
jdbc:mysql://127.0.0.1:3306/spring-boot-demo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2B8
username
:
root
password
:
root
driver-class-name
:
com.mysql.cj.jdbc.Driver
ureport
:
debug
:
false
disableFileProvider
:
false
disableHttpSessionReportCache
:
true
# 单机模式,路径需要提前创建
fileStoreDir
:
'
/Users/yangkai.shen/Desktop/ureport2'
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录