Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datax-cloud
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄营
datax-cloud
Commits
ea8fa0d1
Commit
ea8fa0d1
authored
Jul 30, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目初始化
parent
905c3571
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
MergeDataSource.java
...main/java/cn/datax/commo/office/word/MergeDataSource.java
+1
-1
WordUtil.java
...ce/src/main/java/cn/datax/commo/office/word/WordUtil.java
+6
-2
No files found.
datax-common/datax-common-office/src/main/java/cn/datax/commo/office/word/MergeDataSource.java
View file @
ea8fa0d1
...
...
@@ -40,8 +40,8 @@ public class MergeDataSource {
public
Document
load
(
String
[]
name
,
Object
[]
value
,
String
modelPath
,
List
<
Map
<
String
,
Object
>>
dataList
,
String
tableName
)
throws
Exception
{
Document
doc
=
new
Document
(
modelPath
);
MailMerge
merge
=
doc
.
getMailMerge
();
doc
.
getMailMerge
().
executeWithRegions
(
new
MapMailMergeDataSource
(
dataList
,
tableName
));
merge
.
execute
(
name
,
value
);
merge
.
executeWithRegions
(
new
MapMailMergeDataSource
(
dataList
,
tableName
));
return
doc
;
}
}
datax-common/datax-common-office/src/main/java/cn/datax/commo/office/word/WordUtil.java
View file @
ea8fa0d1
...
...
@@ -50,16 +50,20 @@ public class WordUtil {
/**
* 获取文档
*
* @param fileName 模板文件 F:\模板.docx
* @return
* @throws Exception
*/
public
Document
getDocument
()
throws
Exception
{
return
new
Document
();
public
Document
getDocument
(
String
fileName
)
throws
Exception
{
return
new
Document
(
fileName
);
}
/**
* 获取文档
*
* @param inputStream 模板文件输入流
* @return
* @throws Exception
*/
public
Document
getDocument
(
InputStream
inputStream
)
throws
Exception
{
return
new
Document
(
inputStream
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment