Skip to content

Commit c60a41b

Browse files
committed
doc: add insert sheet
1 parent 6f7ce30 commit c60a41b

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,24 @@ v1.28.0 support CSV insert N rows data after last row
12401240

12411241
![image](https://user-images.githubusercontent.com/12729184/191023733-1e2fa732-db5c-4a3a-9722-b891fe5aa069.png)
12421242

1243+
v1.37.0 support excel insert a new sheet into an existing workbook
1244+
1245+
```csharp
1246+
// Origin excel
1247+
{
1248+
var value = new[] {
1249+
new { ID=1,Name ="Jack",InDate=new DateTime(2021,01,03)},
1250+
new { ID=2,Name ="Henry",InDate=new DateTime(2020,05,03)},
1251+
};
1252+
MiniExcel.SaveAs(path, value, sheetName: "Sheet1");
1253+
}
1254+
// Insert a new sheet
1255+
{
1256+
var value = new { ID=3,Name = "Mike", InDate = new DateTime(2021, 04, 23) };
1257+
MiniExcel.Insert(path, table, sheetName: "Sheet2");
1258+
}
1259+
```
1260+
12431261

12441262

12451263
#### Delete(waiting)

README.zh-CN.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,24 @@ v1.28.0 开始支持 CSV 插入新增,在最后一行新增N笔数据
11231123

11241124
![image](https://user-images.githubusercontent.com/12729184/191023733-1e2fa732-db5c-4a3a-9722-b891fe5aa069.png)
11251125

1126+
v1.37.0 开始支持在现有Excel工作簿中插入新工作表
1127+
1128+
```csharp
1129+
// 原始Excel
1130+
{
1131+
var value = new[] {
1132+
new { ID=1,Name ="Jack",InDate=new DateTime(2021,01,03)},
1133+
new { ID=2,Name ="Henry",InDate=new DateTime(2020,05,03)},
1134+
};
1135+
MiniExcel.SaveAs(path, value, sheetName: "Sheet1");
1136+
}
1137+
// 新增一个Sheet
1138+
{
1139+
var value = new { ID=3,Name = "Mike", InDate = new DateTime(2021, 04, 23) };
1140+
MiniExcel.Insert(path, table, sheetName: "Sheet2");
1141+
}
1142+
```
1143+
11261144

11271145

11281146
#### 删除(未完成)

README.zh-Hant.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,25 @@ v1.28.0 開始支持 CSV 插入新增,在最後一行新增N筆數據
11281128
![image](https://user-images.githubusercontent.com/12729184/191023733-1e2fa732-db5c-4a3a-9722-b891fe5aa069.png)
11291129

11301130

1131+
v1.37.0 開始支持在現有Excel工作簿中插入新工作表
1132+
1133+
```csharp
1134+
// 原始Excel
1135+
{
1136+
var value = new[] {
1137+
new { ID=1,Name ="Jack",InDate=new DateTime(2021,01,03)},
1138+
new { ID=2,Name ="Henry",InDate=new DateTime(2020,05,03)},
1139+
};
1140+
MiniExcel.SaveAs(path, value);
1141+
}
1142+
// 新增一個Sheet
1143+
{
1144+
var value = new { ID=3,Name = "Mike", InDate = new DateTime(2021, 04, 23) };
1145+
MiniExcel.Insert(path, table, sheetName: "Sheet2");
1146+
}
1147+
```
1148+
1149+
11311150

11321151
#### 刪除(未完成)
11331152

0 commit comments

Comments
 (0)