From b1f632d4084130628f10906ff6a7bb55022e4c08 Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 30 Apr 2019 18:39:27 +0800 Subject: Resolve #393, upgrade Go module to v2 --- README_zh.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'README_zh.md') diff --git a/README_zh.md b/README_zh.md index dfed749..044d930 100644 --- a/README_zh.md +++ b/README_zh.md @@ -20,7 +20,7 @@ Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 E ### 安装 ```bash -go get github.com/360EntSecGroup-Skylar/excelize +go get github.com/360EntSecGroup-Skylar/excelize/v2 ``` ### 创建 Excel 文档 @@ -33,7 +33,7 @@ package main import ( "fmt" - "github.com/360EntSecGroup-Skylar/excelize" + "github.com/360EntSecGroup-Skylar/excelize/v2" ) func main() { @@ -63,7 +63,7 @@ package main import ( "fmt" - "github.com/360EntSecGroup-Skylar/excelize" + "github.com/360EntSecGroup-Skylar/excelize/v2" ) func main() { @@ -102,7 +102,7 @@ package main import ( "fmt" - "github.com/360EntSecGroup-Skylar/excelize" + "github.com/360EntSecGroup-Skylar/excelize/v2" ) func main() { @@ -140,7 +140,7 @@ import ( _ "image/jpeg" _ "image/png" - "github.com/360EntSecGroup-Skylar/excelize" + "github.com/360EntSecGroup-Skylar/excelize/v2" ) func main() { -- cgit v1.2.1 From 407fb55c20a2524c4eccad9361120dee2a2719cd Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 21 Aug 2019 23:03:34 +0800 Subject: Update the Godoc --- README_zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README_zh.md') diff --git a/README_zh.md b/README_zh.md index 044d930..d57f301 100644 --- a/README_zh.md +++ b/README_zh.md @@ -13,7 +13,7 @@ ## 简介 -Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 ECMA-376 Office OpenXML 标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的 XLSX 文档。相比较其他的开源类库,Excelize 支持写入原本带有图片(表)、透视表和切片器等复杂样式的文档,还支持向 Excel 文档中插入图片与图表,并且在保存后不会丢失文档原有样式,可以应用于各类报表系统中。使用本类库要求使用的 Go 语言为 1.8 或更高版本,完整的 API 使用文档请访问 [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) 或查看 [参考文档](https://xuri.me/excelize/)。 +Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 ECMA-376 Office OpenXML 标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的 XLSX 文档。相比较其他的开源类库,Excelize 支持写入原本带有图片(表)、透视表和切片器等复杂样式的文档,还支持向 Excel 文档中插入图片与图表,并且在保存后不会丢失文档原有样式,可以应用于各类报表系统中。使用本类库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) 或查看 [参考文档](https://xuri.me/excelize/)。 ## 快速上手 -- cgit v1.2.1 From 0acb3ef9685e80d51dfda5ab9a9db870af7e1614 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 2 Sep 2019 21:52:55 +0800 Subject: Testing files updated --- README_zh.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'README_zh.md') diff --git a/README_zh.md b/README_zh.md index d57f301..6c2b190 100644 --- a/README_zh.md +++ b/README_zh.md @@ -20,7 +20,7 @@ Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 E ### 安装 ```bash -go get github.com/360EntSecGroup-Skylar/excelize/v2 +go get github.com/360EntSecGroup-Skylar/excelize ``` ### 创建 Excel 文档 @@ -33,7 +33,7 @@ package main import ( "fmt" - "github.com/360EntSecGroup-Skylar/excelize/v2" + "github.com/360EntSecGroup-Skylar/excelize" ) func main() { @@ -63,7 +63,7 @@ package main import ( "fmt" - "github.com/360EntSecGroup-Skylar/excelize/v2" + "github.com/360EntSecGroup-Skylar/excelize" ) func main() { @@ -102,7 +102,7 @@ package main import ( "fmt" - "github.com/360EntSecGroup-Skylar/excelize/v2" + "github.com/360EntSecGroup-Skylar/excelize" ) func main() { @@ -140,7 +140,7 @@ import ( _ "image/jpeg" _ "image/png" - "github.com/360EntSecGroup-Skylar/excelize/v2" + "github.com/360EntSecGroup-Skylar/excelize" ) func main() { -- cgit v1.2.1 From 8922f659788187afa6d0a5d3248e999c2c1bb846 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 16 Sep 2019 01:17:35 +0800 Subject: Combine functions: workBookRelsWriter, drawingRelsWriter into relsWriter; drawingRelsReader, workbookRelsReader, workSheetRelsReader into relsReader; addDrawingRelationships, addSheetRelationships into addRels --- README_zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README_zh.md') diff --git a/README_zh.md b/README_zh.md index 6c2b190..d4cac66 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,4 +1,4 @@ -

Excelize logo

+

Excelize logo

Build Status -- cgit v1.2.1 From 09485b3f9f0aefc58d51462aed65c2416205c591 Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 29 Dec 2019 16:02:31 +0800 Subject: Improve code coverage unit tests --- README_zh.md | 71 +++++++++++++++++++++--------------------------------------- 1 file changed, 25 insertions(+), 46 deletions(-) (limited to 'README_zh.md') diff --git a/README_zh.md b/README_zh.md index 57cd645..c1ee83e 100644 --- a/README_zh.md +++ b/README_zh.md @@ -30,11 +30,7 @@ go get github.com/360EntSecGroup-Skylar/excelize ```go package main -import ( - "fmt" - - "github.com/360EntSecGroup-Skylar/excelize" -) +import "github.com/360EntSecGroup-Skylar/excelize" func main() { f := excelize.NewFile() @@ -46,9 +42,8 @@ func main() { // 设置工作簿的默认工作表 f.SetActiveSheet(index) // 根据指定路径保存文件 - err := f.SaveAs("./Book1.xlsx") - if err != nil { - fmt.Println(err) + if err := f.SaveAs("Book1.xlsx"); err != nil { + println(err.Error()) } } ``` @@ -60,32 +55,28 @@ func main() { ```go package main -import ( - "fmt" - - "github.com/360EntSecGroup-Skylar/excelize" -) +import "github.com/360EntSecGroup-Skylar/excelize" func main() { - f, err := excelize.OpenFile("./Book1.xlsx") + f, err := excelize.OpenFile("Book1.xlsx") if err != nil { - fmt.Println(err) + println(err.Error()) return } // 获取工作表中指定单元格的值 cell, err := f.GetCellValue("Sheet1", "B2") if err != nil { - fmt.Println(err) + println(err.Error()) return } - fmt.Println(cell) + println(cell) // 获取 Sheet1 上所有单元格 rows, err := f.GetRows("Sheet1") for _, row := range rows { for _, colCell := range row { - fmt.Print(colCell, "\t") + print(colCell, "\t") } - fmt.Println() + println() } } ``` @@ -99,11 +90,7 @@ func main() { ```go package main -import ( - "fmt" - - "github.com/360EntSecGroup-Skylar/excelize" -) +import "github.com/360EntSecGroup-Skylar/excelize" func main() { categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"} @@ -115,18 +102,15 @@ func main() { for k, v := range values { f.SetCellValue("Sheet1", k, v) } - err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`) - if err != nil { - fmt.Println(err) + if err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`); err != nil { + println(err.Error()) return } // 根据指定路径保存文件 - err = f.SaveAs("./Book1.xlsx") - if err != nil { - fmt.Println(err) + if err := f.SaveAs("Book1.xlsx"); err != nil { + println(err.Error()) } } - ``` ### 向 Excel 文档中插入图片 @@ -135,7 +119,6 @@ func main() { package main import ( - "fmt" _ "image/gif" _ "image/jpeg" _ "image/png" @@ -144,30 +127,26 @@ import ( ) func main() { - f, err := excelize.OpenFile("./Book1.xlsx") + f, err := excelize.OpenFile("Book1.xlsx") if err != nil { - fmt.Println(err) + println(err.Error()) return } // 插入图片 - err = f.AddPicture("Sheet1", "A2", "./image1.png", "") - if err != nil { - fmt.Println(err) + if err := f.AddPicture("Sheet1", "A2", "image.png", ""); err != nil { + println(err.Error()) } // 在工作表中插入图片,并设置图片的缩放比例 - err = f.AddPicture("Sheet1", "D2", "./image2.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`) - if err != nil { - fmt.Println(err) + if err := f.AddPicture("Sheet1", "D2", "image.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`); err != nil { + println(err.Error()) } // 在工作表中插入图片,并设置图片的打印属性 - err = f.AddPicture("Sheet1", "H2", "./image3.gif", `{"x_offset": 15, "y_offset": 10, "print_obj": true, "lock_aspect_ratio": false, "locked": false}`) - if err != nil { - fmt.Println(err) + if err := f.AddPicture("Sheet1", "H2", "image.gif", `{"x_offset": 15, "y_offset": 10, "print_obj": true, "lock_aspect_ratio": false, "locked": false}`); err != nil { + println(err.Error()) } // 保存文件 - err = f.Save() - if err != nil { - fmt.Println(err) + if err = f.Save(); err != nil { + println(err.Error()) } } ``` -- cgit v1.2.1 From ad883caa0f77dfc016ae99bd5fbb606953eb99a0 Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 19 Feb 2020 00:08:10 +0800 Subject: Resolve #580, revert commit https://github.com/360EntSecGroup-Skylar/excelize/commit/5ca7231ed408ac264f509ff52b5d28ff4fbda757 --- README_zh.md | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'README_zh.md') diff --git a/README_zh.md b/README_zh.md index c1ee83e..f75eec5 100644 --- a/README_zh.md +++ b/README_zh.md @@ -30,7 +30,11 @@ go get github.com/360EntSecGroup-Skylar/excelize ```go package main -import "github.com/360EntSecGroup-Skylar/excelize" +import ( + "fmt" + + "github.com/360EntSecGroup-Skylar/excelize" +) func main() { f := excelize.NewFile() @@ -43,7 +47,7 @@ func main() { f.SetActiveSheet(index) // 根据指定路径保存文件 if err := f.SaveAs("Book1.xlsx"); err != nil { - println(err.Error()) + fmt.Println(err) } } ``` @@ -55,28 +59,32 @@ func main() { ```go package main -import "github.com/360EntSecGroup-Skylar/excelize" +import ( + "fmt" + + "github.com/360EntSecGroup-Skylar/excelize" +) func main() { f, err := excelize.OpenFile("Book1.xlsx") if err != nil { - println(err.Error()) + fmt.Println(err) return } // 获取工作表中指定单元格的值 cell, err := f.GetCellValue("Sheet1", "B2") if err != nil { - println(err.Error()) + fmt.Println(err) return } - println(cell) + fmt.Println(cell) // 获取 Sheet1 上所有单元格 rows, err := f.GetRows("Sheet1") for _, row := range rows { for _, colCell := range row { - print(colCell, "\t") + fmt.Print(colCell, "\t") } - println() + fmt.Println() } } ``` @@ -90,7 +98,11 @@ func main() { ```go package main -import "github.com/360EntSecGroup-Skylar/excelize" +import ( + "fmt" + + "github.com/360EntSecGroup-Skylar/excelize" +) func main() { categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"} @@ -103,12 +115,12 @@ func main() { f.SetCellValue("Sheet1", k, v) } if err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`); err != nil { - println(err.Error()) + fmt.Println(err) return } // 根据指定路径保存文件 if err := f.SaveAs("Book1.xlsx"); err != nil { - println(err.Error()) + fmt.Println(err) } } ``` @@ -119,6 +131,7 @@ func main() { package main import ( + "fmt" _ "image/gif" _ "image/jpeg" _ "image/png" @@ -129,24 +142,24 @@ import ( func main() { f, err := excelize.OpenFile("Book1.xlsx") if err != nil { - println(err.Error()) + fmt.Println(err) return } // 插入图片 if err := f.AddPicture("Sheet1", "A2", "image.png", ""); err != nil { - println(err.Error()) + fmt.Println(err) } // 在工作表中插入图片,并设置图片的缩放比例 if err := f.AddPicture("Sheet1", "D2", "image.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`); err != nil { - println(err.Error()) + fmt.Println(err) } // 在工作表中插入图片,并设置图片的打印属性 if err := f.AddPicture("Sheet1", "H2", "image.gif", `{"x_offset": 15, "y_offset": 10, "print_obj": true, "lock_aspect_ratio": false, "locked": false}`); err != nil { - println(err.Error()) + fmt.Println(err) } // 保存文件 if err = f.Save(); err != nil { - println(err.Error()) + fmt.Println(err) } } ``` -- cgit v1.2.1 From 6dcb7013eeeb8902be97c564c7a5a05dddcb06b8 Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 21 Feb 2020 23:07:43 +0800 Subject: Resolve #582, support to set date field subtotal and names for pivot table - typo fixed and update do.dev badge in the README. --- README_zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README_zh.md') diff --git a/README_zh.md b/README_zh.md index f75eec5..44ab9b5 100644 --- a/README_zh.md +++ b/README_zh.md @@ -4,7 +4,7 @@ Build Status Code Coverage Go Report Card - GoDoc + go.dev Licenses Donate

-- cgit v1.2.1 From 1e3c85024d3bbc650c2f6a85fb075804af74720b Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 3 Mar 2020 00:15:03 +0800 Subject: Resolve #571, init remove conditional format support --- README_zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README_zh.md') diff --git a/README_zh.md b/README_zh.md index 44ab9b5..18db28f 100644 --- a/README_zh.md +++ b/README_zh.md @@ -13,7 +13,7 @@ ## 简介 -Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 ECMA-376 Office OpenXML 标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的 XLSX 文档。相比较其他的开源类库,Excelize 支持写入原本带有图片(表)、透视表和切片器等复杂样式的文档,还支持向 Excel 文档中插入图片与图表,并且在保存后不会丢失文档原有样式,可以应用于各类报表系统中。使用本类库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) 或查看 [参考文档](https://xuri.me/excelize/)。 +Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 ECMA-376 Office OpenXML 标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的 XLSX 文档。相比较其他的开源类库,Excelize 支持写入原本带有图片(表)、透视表和切片器等复杂样式的文档,还支持向 Excel 文档中插入图片与图表,并且在保存后不会丢失文档原有样式,可以应用于各类报表系统中。使用本类库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [go.dev](https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc) 或查看 [参考文档](https://xuri.me/excelize/)。 ## 快速上手 -- cgit v1.2.1 From 1fe660df648422a53eef0c735657cb2f5237ef7b Mon Sep 17 00:00:00 2001 From: xuri Date: Thu, 23 Apr 2020 02:01:14 +0800 Subject: - Resolve #485 use sheet index instead of ID - added 3 internal function: getSheetID, getActiveSheetID, getSheetNameByID --- README_zh.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'README_zh.md') diff --git a/README_zh.md b/README_zh.md index 18db28f..deba22a 100644 --- a/README_zh.md +++ b/README_zh.md @@ -13,7 +13,7 @@ ## 简介 -Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 ECMA-376 Office OpenXML 标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的 XLSX 文档。相比较其他的开源类库,Excelize 支持写入原本带有图片(表)、透视表和切片器等复杂样式的文档,还支持向 Excel 文档中插入图片与图表,并且在保存后不会丢失文档原有样式,可以应用于各类报表系统中。使用本类库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [go.dev](https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc) 或查看 [参考文档](https://xuri.me/excelize/)。 +Excelize 是 Go 语言编写的用于操作 Office Excel 文档基础库,基于 ECMA-376,ISO/IEC 29500 国际标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM 等多种文档格式,高度兼容带有样式、图片(表)、透视表、切片器等复杂组件的文档,并提供流式读写 API,用于处理包含大规模数据的工作簿。可应用于各类报表平台、云计算、边缘计算等系统。使用本类库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [go.dev](https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc) 或查看 [参考文档](https://xuri.me/excelize/)。 ## 快速上手 @@ -23,6 +23,12 @@ Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 E go get github.com/360EntSecGroup-Skylar/excelize ``` +- 如果您使用 [Go Modules](https://blog.golang.org/using-go-modules) 管理软件包,请使用下面的命令来安装最新版本。 + +```bash +go get github.com/360EntSecGroup-Skylar/excelize/v2 +``` + ### 创建 Excel 文档 下面是一个创建 Excel 文档的简单例子: -- cgit v1.2.1