Skip to content

Commit 57d6ad5

Browse files
committed
- Support table generate · Issue #13
- 0.3.0
1 parent 5b70fbd commit 57d6ad5

File tree

14 files changed

+516
-235
lines changed

14 files changed

+516
-235
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,48 @@ Template
9898

9999
![image](https://user-images.githubusercontent.com/12729184/190645704-1f6405e9-71e3-45b9-aa99-2ba52e5e1519.png)
100100

101+
### Table
102+
103+
Tag value is `IEmerable<Dictionary<string,object>>` type
104+
105+
##### Example
106+
107+
```csharp
108+
var value = new Dictionary<string, object>()
109+
{
110+
["TripHs"] = new List<Dictionary<string, object>>
111+
{
112+
new Dictionary<string, object>
113+
{
114+
{ "sDate",DateTime.Parse("2022-09-08 08:30:00")},
115+
{ "eDate",DateTime.Parse("2022-09-08 15:00:00")},
116+
{ "How","Discussion requirement part1"},
117+
{ "Photo",new MiniWordPicture() { Path = PathHelper.GetFile("DemoExpenseMeeting02.png"), Width = 160, Height = 90 }},
118+
},
119+
new Dictionary<string, object>
120+
{
121+
{ "sDate",DateTime.Parse("2022-09-09 08:30:00")},
122+
{ "eDate",DateTime.Parse("2022-09-09 17:00:00")},
123+
{ "How","Discussion requirement part2 and development"},
124+
{ "Photo",new MiniWordPicture() { Path = PathHelper.GetFile("DemoExpenseMeeting01.png"), Width = 160, Height = 90 }},
125+
},
126+
}
127+
};
128+
MiniWord.SaveAsByTemplate(path, templatePath, value);
129+
```
130+
131+
##### Template
132+
133+
![image](https://user-images.githubusercontent.com/12729184/190843632-05bb6459-f1c1-4bdc-a79b-54889afdfeea.png)
134+
135+
136+
##### Result
137+
138+
![image](https://user-images.githubusercontent.com/12729184/190843663-c00baf16-21f2-4579-9d08-996a2c8c549b.png)
139+
140+
141+
142+
101143

102144

103145
## Support Me : [Donate Link](https://miniexcel.github.io/)

README.zh-CN.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ MiniWord.SaveAsByTemplate(path, templatePath, value);
7575

7676
![image](https://user-images.githubusercontent.com/12729184/190647953-6f9da393-e666-4658-a56d-b3a7f13c0ea1.png)
7777

78-
##### 效果
78+
##### 导出
7979

8080
![image](https://user-images.githubusercontent.com/12729184/190648179-30258d82-723d-4266-b711-43f132d1842d.png)
8181

@@ -98,10 +98,53 @@ MiniWord.SaveAsByTemplate(path, templatePath, value);
9898

9999
![image](https://user-images.githubusercontent.com/12729184/190645513-230c54f3-d38f-47af-b844-0c8c1eff2f52.png)
100100

101-
##### 效果
101+
##### 导出
102102

103103
![image](https://user-images.githubusercontent.com/12729184/190645704-1f6405e9-71e3-45b9-aa99-2ba52e5e1519.png)
104104

105+
### 表格
106+
107+
标签值为 `IEmerable<Dictionary<string,object>>`类别
108+
109+
##### 代码例子
110+
111+
```csharp
112+
var value = new Dictionary<string, object>()
113+
{
114+
["TripHs"] = new List<Dictionary<string, object>>
115+
{
116+
new Dictionary<string, object>
117+
{
118+
{ "sDate",DateTime.Parse("2022-09-08 08:30:00")},
119+
{ "eDate",DateTime.Parse("2022-09-08 15:00:00")},
120+
{ "How","Discussion requirement part1"},
121+
{ "Photo",new MiniWordPicture() { Path = PathHelper.GetFile("DemoExpenseMeeting02.png"), Width = 160, Height = 90 }},
122+
},
123+
new Dictionary<string, object>
124+
{
125+
{ "sDate",DateTime.Parse("2022-09-09 08:30:00")},
126+
{ "eDate",DateTime.Parse("2022-09-09 17:00:00")},
127+
{ "How","Discussion requirement part2 and development"},
128+
{ "Photo",new MiniWordPicture() { Path = PathHelper.GetFile("DemoExpenseMeeting01.png"), Width = 160, Height = 90 }},
129+
},
130+
}
131+
};
132+
MiniWord.SaveAsByTemplate(path, templatePath, value);
133+
```
134+
135+
##### 模版
136+
137+
![image](https://user-images.githubusercontent.com/12729184/190843632-05bb6459-f1c1-4bdc-a79b-54889afdfeea.png)
138+
139+
140+
##### 导出
141+
142+
![image](https://user-images.githubusercontent.com/12729184/190843663-c00baf16-21f2-4579-9d08-996a2c8c549b.png)
143+
144+
145+
146+
147+
105148
## 支持我 : [Donate Link](https://miniexcel.github.io/)
106149

107150
<a href="https://user-images.githubusercontent.com/12729184/158003727-ca348041-5e59-44bc-a694-f400777e0252.jpg"><img src="https://user-images.githubusercontent.com/12729184/158003727-ca348041-5e59-44bc-a694-f400777e0252.jpg" alt="wechat" width="200px" height="300px">

README.zh-Hant.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,50 @@ MiniWord.SaveAsByTemplate(path, templatePath, value);
106106

107107
![image](https://user-images.githubusercontent.com/12729184/190645704-1f6405e9-71e3-45b9-aa99-2ba52e5e1519.png)
108108

109+
### 表格
110+
111+
標籤值為 `IEmerable<Dictionary<string,object>>`類別
112+
113+
##### 代碼例子
114+
115+
```csharp
116+
var value = new Dictionary<string, object>()
117+
{
118+
["TripHs"] = new List<Dictionary<string, object>>
119+
{
120+
new Dictionary<string, object>
121+
{
122+
{ "sDate",DateTime.Parse("2022-09-08 08:30:00")},
123+
{ "eDate",DateTime.Parse("2022-09-08 15:00:00")},
124+
{ "How","Discussion requirement part1"},
125+
{ "Photo",new MiniWordPicture() { Path = PathHelper.GetFile("DemoExpenseMeeting02.png"), Width = 160, Height = 90 }},
126+
},
127+
new Dictionary<string, object>
128+
{
129+
{ "sDate",DateTime.Parse("2022-09-09 08:30:00")},
130+
{ "eDate",DateTime.Parse("2022-09-09 17:00:00")},
131+
{ "How","Discussion requirement part2 and development"},
132+
{ "Photo",new MiniWordPicture() { Path = PathHelper.GetFile("DemoExpenseMeeting01.png"), Width = 160, Height = 90 }},
133+
},
134+
}
135+
};
136+
MiniWord.SaveAsByTemplate(path, templatePath, value);
137+
```
138+
139+
##### 模版
140+
141+
![image](https://user-images.githubusercontent.com/12729184/190843632-05bb6459-f1c1-4bdc-a79b-54889afdfeea.png)
142+
143+
144+
##### 導出
145+
146+
![image](https://user-images.githubusercontent.com/12729184/190843663-c00baf16-21f2-4579-9d08-996a2c8c549b.png)
147+
148+
149+
150+
151+
152+
109153

110154
## 支持我 : [Donate Link](https://miniexcel.github.io/)
111155

release-note/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525

2626

2727
### 0.3.0
28+
- [New] Support table generate #13
2829
- [New] datetime format -> yyyy-MM-dd HH:mm:ss
30+
- [Bug] fixed spliting template string like `<w:t>{</w:t><w:t>{<w:/t><w:t>Tag</w:t><w:t>}</w:t><w:t>}<w:/t>` problem #17
2931

3032

3133
### 0.2.1

release-note/README.zh-CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525

2626

2727
### 0.3.0
28+
- [New] 支持 table 标签 #13
2829
- [New] datetime format -> yyyy-MM-dd HH:mm:ss
30+
- [Bug] fixed spliting template string like `<w:t>{</w:t><w:t>{<w:/t><w:t>Tag</w:t><w:t>}</w:t><w:t>}<w:/t>` problem #17
2931

3032
### 0.2.1
3133

release-note/README.zh-Hant.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525

2626

2727
### 0.3.0
28+
29+
- [New] 支持 table 标签 #13
30+
2831
- [New] datetime format -> yyyy-MM-dd HH:mm:ss
32+
- [Bug] fixed spliting template string like `<w:t>{</w:t><w:t>{<w:/t><w:t>Tag</w:t><w:t>}</w:t><w:t>}<w:/t>` problem #17
2933

3034
### 0.2.1
3135

52.8 KB
Loading
52.4 KB
Loading

samples/docx/TestExpenseDemo.docx

-11.6 KB
Binary file not shown.

samples/docx/TestIssue17.docx

11.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)