Skip to content

Commit

Permalink
update version and doc cn
Browse files Browse the repository at this point in the history
  • Loading branch information
shps951023 committed May 28, 2023
1 parent c62b881 commit 645a7cf
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 3 deletions.
62 changes: 62 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,68 @@ memoryStream.MergeSameCells(path);
![before_merge_cells](https://user-images.githubusercontent.com/38832863/219970175-913b3d04-d714-4279-a7a4-6cefb7aa6ce8.PNG)
![after_merge_cells](https://user-images.githubusercontent.com/38832863/219970176-e78c491a-2f90-45a7-a4a2-425c5708d38c.PNG)

#### 13. 是否写入 null values cell

预设:

```csharp
DataTable dt = new DataTable();

/* ... */

DataRow dr = dt.NewRow();

dr["Name1"] = "Somebody once";
dr["Name2"] = null;
dr["Name3"] = "told me.";

dt.Rows.Add(dr);

MiniExcel.SaveAs(@"C:\temp\Book1.xlsx", dt);
```

![image](https://user-images.githubusercontent.com/31481586/241419441-c4f27e8f-3f87-46db-a10f-08665864c874.png)

```xml
<x:row r="2">
<x:c r="A2" t ="str" s="2">
<x:v>Somebody once</x:v>
</x:c>
<x:c r="B2" t ="str" s="2">
<x:v></x:v>
</x:c>
<x:c r="C2" t ="str" s="2">
<x:v>told me.</x:v>
</x:c>
</x:row>
```

设定不写入:

```csharp
OpenXmlConfiguration configuration = new OpenXmlConfiguration()
{
EnableWriteNullValueCell = false // Default value is true.
};

MiniExcel.SaveAs(@"C:\temp\Book1.xlsx", dt, configuration: configuration);
```

![image](https://user-images.githubusercontent.com/31481586/241419455-3c0aec8a-4e5f-4d83-b7ec-6572124c165d.png)


```xml
<x:row r="2">
<x:c r="A2" t ="str" s="2">
<x:v>Somebody once</x:v>
</x:c>
<x:c r="B2" s="2"></x:c>
<x:c r="C2" t ="str" s="2">
<x:v>told me.</x:v>
</x:c>
</x:row>
```




Expand Down
64 changes: 64 additions & 0 deletions README.zh-Hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,70 @@ memoryStream.MergeSameCells(path);



#### 13. 是否寫入 null values cell

預設:

```csharp
DataTable dt = new DataTable();

/* ... */

DataRow dr = dt.NewRow();

dr["Name1"] = "Somebody once";
dr["Name2"] = null;
dr["Name3"] = "told me.";

dt.Rows.Add(dr);

MiniExcel.SaveAs(@"C:\temp\Book1.xlsx", dt);
```

![image](https://user-images.githubusercontent.com/31481586/241419441-c4f27e8f-3f87-46db-a10f-08665864c874.png)

```xml
<x:row r="2">
<x:c r="A2" t ="str" s="2">
<x:v>Somebody once</x:v>
</x:c>
<x:c r="B2" t ="str" s="2">
<x:v></x:v>
</x:c>
<x:c r="C2" t ="str" s="2">
<x:v>told me.</x:v>
</x:c>
</x:row>
```

設定不寫入:

```csharp
OpenXmlConfiguration configuration = new OpenXmlConfiguration()
{
EnableWriteNullValueCell = false // Default value is true.
};

MiniExcel.SaveAs(@"C:\temp\Book1.xlsx", dt, configuration: configuration);
```

![image](https://user-images.githubusercontent.com/31481586/241419455-3c0aec8a-4e5f-4d83-b7ec-6572124c165d.png)


```xml
<x:row r="2">
<x:c r="A2" t ="str" s="2">
<x:v>Somebody once</x:v>
</x:c>
<x:c r="B2" s="2"></x:c>
<x:c r="C2" t ="str" s="2">
<x:v>told me.</x:v>
</x:c>
</x:row>
```



### 模板填充 Excel <a name="getstart3"></a>

- 宣告方式類似 Vue 模板 `{{變量名稱}}`, 或是集合渲染 `{{集合名稱.欄位名稱}}`
Expand Down
7 changes: 5 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@

---

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

### 1.30.3
- [New] support if/else statements inside cell (via @eynarhaji)
Expand Down
7 changes: 7 additions & 0 deletions docs/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@



### 1.31.0

- [New] 支持 Fields #490 (via @jsgervais)
- [New] 支持是否写入 null values cell #497 (via @0MG-DEN)
- [Bug] 修复calc chain.xml 问题 #491(via @ArgoZhang)
- [Bug] 修复特定文件 `/xl` 定位错误 #494 (via @ArgoZhang)

### 1.30.3
- [New] 模版支持 if/else 单元格语句 (via @eynarhaji)

Expand Down
6 changes: 6 additions & 0 deletions docs/README.zh-Hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@

---

### 1.31.0
- [New] 支持 Fields #490 (via @jsgervais)
- [New] 支持是否寫入 null values cell #497 (via @0MG-DEN)
- [Bug] 修復calc chain.xml 問題 #491(via @ArgoZhang)
- [Bug] 修復特定文件 `/xl` 定位錯誤 #494 (via @ArgoZhang)

### 1.30.3
- [New] 模版支持 if/else 單元格語句 (via @eynarhaji)

Expand Down
2 changes: 1 addition & 1 deletion src/MiniExcel/MiniExcelLibs.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<Version>1.30.3</Version>
<Version>1.31.0</Version>
</PropertyGroup>
<PropertyGroup>
<AssemblyName>MiniExcel</AssemblyName>
Expand Down

0 comments on commit 645a7cf

Please sign in to comment.