Skip to content

Commit 645a7cf

Browse files
committed
update version and doc cn
1 parent c62b881 commit 645a7cf

File tree

6 files changed

+145
-3
lines changed

6 files changed

+145
-3
lines changed

README.zh-CN.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,68 @@ memoryStream.MergeSameCells(path);
561561
![before_merge_cells](https://user-images.githubusercontent.com/38832863/219970175-913b3d04-d714-4279-a7a4-6cefb7aa6ce8.PNG)
562562
![after_merge_cells](https://user-images.githubusercontent.com/38832863/219970176-e78c491a-2f90-45a7-a4a2-425c5708d38c.PNG)
563563

564+
#### 13. 是否写入 null values cell
565+
566+
预设:
567+
568+
```csharp
569+
DataTable dt = new DataTable();
570+
571+
/* ... */
572+
573+
DataRow dr = dt.NewRow();
574+
575+
dr["Name1"] = "Somebody once";
576+
dr["Name2"] = null;
577+
dr["Name3"] = "told me.";
578+
579+
dt.Rows.Add(dr);
580+
581+
MiniExcel.SaveAs(@"C:\temp\Book1.xlsx", dt);
582+
```
583+
584+
![image](https://user-images.githubusercontent.com/31481586/241419441-c4f27e8f-3f87-46db-a10f-08665864c874.png)
585+
586+
```xml
587+
<x:row r="2">
588+
<x:c r="A2" t ="str" s="2">
589+
<x:v>Somebody once</x:v>
590+
</x:c>
591+
<x:c r="B2" t ="str" s="2">
592+
<x:v></x:v>
593+
</x:c>
594+
<x:c r="C2" t ="str" s="2">
595+
<x:v>told me.</x:v>
596+
</x:c>
597+
</x:row>
598+
```
599+
600+
设定不写入:
601+
602+
```csharp
603+
OpenXmlConfiguration configuration = new OpenXmlConfiguration()
604+
{
605+
EnableWriteNullValueCell = false // Default value is true.
606+
};
607+
608+
MiniExcel.SaveAs(@"C:\temp\Book1.xlsx", dt, configuration: configuration);
609+
```
610+
611+
![image](https://user-images.githubusercontent.com/31481586/241419455-3c0aec8a-4e5f-4d83-b7ec-6572124c165d.png)
612+
613+
614+
```xml
615+
<x:row r="2">
616+
<x:c r="A2" t ="str" s="2">
617+
<x:v>Somebody once</x:v>
618+
</x:c>
619+
<x:c r="B2" s="2"></x:c>
620+
<x:c r="C2" t ="str" s="2">
621+
<x:v>told me.</x:v>
622+
</x:c>
623+
</x:row>
624+
```
625+
564626

565627

566628

README.zh-Hant.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,70 @@ memoryStream.MergeSameCells(path);
557557

558558

559559

560+
#### 13. 是否寫入 null values cell
561+
562+
預設:
563+
564+
```csharp
565+
DataTable dt = new DataTable();
566+
567+
/* ... */
568+
569+
DataRow dr = dt.NewRow();
570+
571+
dr["Name1"] = "Somebody once";
572+
dr["Name2"] = null;
573+
dr["Name3"] = "told me.";
574+
575+
dt.Rows.Add(dr);
576+
577+
MiniExcel.SaveAs(@"C:\temp\Book1.xlsx", dt);
578+
```
579+
580+
![image](https://user-images.githubusercontent.com/31481586/241419441-c4f27e8f-3f87-46db-a10f-08665864c874.png)
581+
582+
```xml
583+
<x:row r="2">
584+
<x:c r="A2" t ="str" s="2">
585+
<x:v>Somebody once</x:v>
586+
</x:c>
587+
<x:c r="B2" t ="str" s="2">
588+
<x:v></x:v>
589+
</x:c>
590+
<x:c r="C2" t ="str" s="2">
591+
<x:v>told me.</x:v>
592+
</x:c>
593+
</x:row>
594+
```
595+
596+
設定不寫入:
597+
598+
```csharp
599+
OpenXmlConfiguration configuration = new OpenXmlConfiguration()
600+
{
601+
EnableWriteNullValueCell = false // Default value is true.
602+
};
603+
604+
MiniExcel.SaveAs(@"C:\temp\Book1.xlsx", dt, configuration: configuration);
605+
```
606+
607+
![image](https://user-images.githubusercontent.com/31481586/241419455-3c0aec8a-4e5f-4d83-b7ec-6572124c165d.png)
608+
609+
610+
```xml
611+
<x:row r="2">
612+
<x:c r="A2" t ="str" s="2">
613+
<x:v>Somebody once</x:v>
614+
</x:c>
615+
<x:c r="B2" s="2"></x:c>
616+
<x:c r="C2" t ="str" s="2">
617+
<x:v>told me.</x:v>
618+
</x:c>
619+
</x:row>
620+
```
621+
622+
623+
560624
### 模板填充 Excel <a name="getstart3"></a>
561625

562626
- 宣告方式類似 Vue 模板 `{{變量名稱}}`, 或是集合渲染 `{{集合名稱.欄位名稱}}`

docs/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222

2323
---
2424

25-
### 1.30.4
26-
- [New] Support skipping null values when writing to Excel (via @0MG-DEN)
25+
### 1.31.0
26+
- [New] Support Fields #490 (via @jsgervais)
27+
- [New] Support skipping null values when writing to Excel #497 (via @0MG-DEN)
28+
- [Bug] Fix calc chain.xml #491(via @ArgoZhang)
29+
- [Bug] Support some sheet `/xl` location error #494 (via @ArgoZhang)
2730

2831
### 1.30.3
2932
- [New] support if/else statements inside cell (via @eynarhaji)

docs/README.zh-CN.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727

2828

2929

30+
### 1.31.0
31+
32+
- [New] 支持 Fields #490 (via @jsgervais)
33+
- [New] 支持是否写入 null values cell #497 (via @0MG-DEN)
34+
- [Bug] 修复calc chain.xml 问题 #491(via @ArgoZhang)
35+
- [Bug] 修复特定文件 `/xl` 定位错误 #494 (via @ArgoZhang)
36+
3037
### 1.30.3
3138
- [New] 模版支持 if/else 单元格语句 (via @eynarhaji)
3239

docs/README.zh-Hant.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424

2525
---
2626

27+
### 1.31.0
28+
- [New] 支持 Fields #490 (via @jsgervais)
29+
- [New] 支持是否寫入 null values cell #497 (via @0MG-DEN)
30+
- [Bug] 修復calc chain.xml 問題 #491(via @ArgoZhang)
31+
- [Bug] 修復特定文件 `/xl` 定位錯誤 #494 (via @ArgoZhang)
32+
2733
### 1.30.3
2834
- [New] 模版支持 if/else 單元格語句 (via @eynarhaji)
2935

src/MiniExcel/MiniExcelLibs.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
4-
<Version>1.30.3</Version>
4+
<Version>1.31.0</Version>
55
</PropertyGroup>
66
<PropertyGroup>
77
<AssemblyName>MiniExcel</AssemblyName>

0 commit comments

Comments
 (0)