# WordReport
**Repository Path**: logbug/WordReport
## Basic Information
- **Project Name**: WordReport
- **Description**: init
- **Primary Language**: Java
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 1
- **Created**: 2021-10-29
- **Last Updated**: 2022-06-07
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# WordReport
根据模版导出docx报表。
模版语法支持:变量表达式、foreach循环(支持无限级嵌套)、if、Merge(垂直方向上合并单元格)
具体用法,参考测试用例
Export the docx report according to the template.
Template syntax support: variable expression, foreach loop (support infinite nesting), if, Merge (merge cells in the vertical direction).
for specific usage, refer to the test case
## 添加依赖
``` xml
top.logbug.wordreport
wordreport
1.0
pom
```
## 基本用法(Basic usage):
``` java
Map context = new HashMap<>();
Map relation = new HashMap<>();
context.put("list", CollectionUtil.toList(relation));
relation.put("upstreamDocName", "需求文档");
relation.put("docName", "设计文档");
relation.put("upstreamDocTitle", "需求文档");
relation.put("docTitle", "设计文档");
relation.put("upReqTitle", "需求");
relation.put("upSectionTitle", "章节");
relation.put("reqTitle", "标识");
relation.put("sectionTitle", "章节");
Map req = new HashMap<>();
relation.put("reqList", CollectionUtil.toList(req, req));
req.put("reqName", "设计1");
req.put("section", "标题1");
req.put("upReqName", "需求1");
req.put("upSection", "标题1");
WordReport.exportDocx("template.docx", context, "report.docx");
```
## 模版如下(Template):

## 导出报表如下(Report):
