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.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index eae0072..91155e3 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Supports saving a file without losing original charts of XLSX. This library need ### Installation ```bash -go get github.com/360EntSecGroup-Skylar/excelize +go get github.com/360EntSecGroup-Skylar/excelize/v2 ``` ### Create XLSX file @@ -34,7 +34,7 @@ package main import ( "fmt" - "github.com/360EntSecGroup-Skylar/excelize" + "github.com/360EntSecGroup-Skylar/excelize/v2" ) func main() { @@ -64,7 +64,7 @@ package main import ( "fmt" - "github.com/360EntSecGroup-Skylar/excelize" + "github.com/360EntSecGroup-Skylar/excelize/v2" ) func main() { @@ -103,7 +103,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 acd76425c2ee55c45a51cf7f71c8a6187a09f507 Mon Sep 17 00:00:00 2001 From: Harris Date: Wed, 7 Aug 2019 16:26:13 -0500 Subject: Handle multi row inline strings The inline string struct is actually the same as the shared strings struct, reuse it. Note that Go version 1.10 is required. Fixes #462 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 91155e3..4bb7d66 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ## Introduction Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLSX files. Supports reading and writing XLSX file generated by Microsoft Excel™ 2007 and later. -Supports saving a file without losing original charts of XLSX. This library needs Go version 1.8 or later. The full API docs can be seen using go's built-in documentation tool, or online at [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) and [docs reference](https://xuri.me/excelize/). +Supports saving a file without losing original charts of XLSX. This library needs Go version 1.10 or later. The full API docs can be seen using go's built-in documentation tool, or online at [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) and [docs reference](https://xuri.me/excelize/). ## Basic Usage -- cgit v1.2.1 From 875dd22bd013ef3873711c8e82f3d4d5e1675ebc Mon Sep 17 00:00:00 2001 From: Matthew McFarling Date: Wed, 28 Aug 2019 17:05:27 -0400 Subject: Updating Readme Removing the /v2 on the package url as it does not work with the ```go get``` command. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 4bb7d66..7f9cf70 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Supports saving a file without losing original charts of XLSX. This library need ### Installation ```bash -go get github.com/360EntSecGroup-Skylar/excelize/v2 +go get github.com/360EntSecGroup-Skylar/excelize ``` ### Create XLSX file @@ -34,7 +34,7 @@ package main import ( "fmt" - "github.com/360EntSecGroup-Skylar/excelize/v2" + "github.com/360EntSecGroup-Skylar/excelize" ) func main() { @@ -64,7 +64,7 @@ package main import ( "fmt" - "github.com/360EntSecGroup-Skylar/excelize/v2" + "github.com/360EntSecGroup-Skylar/excelize" ) func main() { @@ -103,7 +103,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.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 7f9cf70..998a4c1 100644 --- a/README.md +++ b/README.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.md | 70 +++++++++++++++++++++++---------------------------------------- 1 file changed, 25 insertions(+), 45 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 03e33ae..d7f696c 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,7 @@ Here is a minimal example usage that will create XLSX file. ```go package main -import ( - "fmt" - - "github.com/360EntSecGroup-Skylar/excelize" -) +import "github.com/360EntSecGroup-Skylar/excelize" func main() { f := excelize.NewFile() @@ -47,9 +43,8 @@ func main() { // Set active sheet of the workbook. f.SetActiveSheet(index) // Save xlsx file by the given path. - err := f.SaveAs("./Book1.xlsx") - if err != nil { - fmt.Println(err) + if err := f.SaveAs("Book1.xlsx"); err != nil { + println(err.Error()) } } ``` @@ -61,32 +56,28 @@ The following constitutes the bare to read a XLSX document. ```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 } // Get value from cell by given worksheet name and axis. cell, err := f.GetCellValue("Sheet1", "B2") if err != nil { - fmt.Println(err) + println(err.Error()) return } - fmt.Println(cell) + println(cell) // Get all the rows in the Sheet1. rows, err := f.GetRows("Sheet1") for _, row := range rows { for _, colCell := range row { - fmt.Print(colCell, "\t") + print(colCell, "\t") } - fmt.Println() + println() } } ``` @@ -100,11 +91,7 @@ With Excelize chart generation and management is as easy as a few lines of code. ```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"} @@ -116,15 +103,13 @@ 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 } // Save xlsx file by the given path. - err = f.SaveAs("./Book1.xlsx") - if err != nil { - fmt.Println(err) + if err := f.SaveAs("Book1.xlsx"); err != nil { + println(err.Error()) } } ``` @@ -135,7 +120,6 @@ func main() { package main import ( - "fmt" _ "image/gif" _ "image/jpeg" _ "image/png" @@ -144,30 +128,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 } // Insert a picture. - 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()) } // Insert a picture to worksheet with scaling. - 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()) } // Insert a picture offset in the cell with printing support. - 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()) } // Save the xlsx file with the origin path. - 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.md | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index d7f696c..c81efd1 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,11 @@ Here is a minimal example usage that will create XLSX file. ```go package main -import "github.com/360EntSecGroup-Skylar/excelize" +import ( + "fmt" + + "github.com/360EntSecGroup-Skylar/excelize" +) func main() { f := excelize.NewFile() @@ -44,7 +48,7 @@ func main() { f.SetActiveSheet(index) // Save xlsx file by the given path. if err := f.SaveAs("Book1.xlsx"); err != nil { - println(err.Error()) + fmt.Println(err) } } ``` @@ -56,28 +60,32 @@ The following constitutes the bare to read a XLSX document. ```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 } // Get value from cell by given worksheet name and axis. cell, err := f.GetCellValue("Sheet1", "B2") if err != nil { - println(err.Error()) + fmt.Println(err) return } - println(cell) + fmt.Println(cell) // Get all the rows in the Sheet1. rows, err := f.GetRows("Sheet1") for _, row := range rows { for _, colCell := range row { - print(colCell, "\t") + fmt.Print(colCell, "\t") } - println() + fmt.Println() } } ``` @@ -91,7 +99,11 @@ With Excelize chart generation and management is as easy as a few lines of code. ```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"} @@ -104,12 +116,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 } // Save xlsx file by the given path. if err := f.SaveAs("Book1.xlsx"); err != nil { - println(err.Error()) + fmt.Println(err) } } ``` @@ -120,6 +132,7 @@ func main() { package main import ( + "fmt" _ "image/gif" _ "image/jpeg" _ "image/png" @@ -130,24 +143,24 @@ import ( func main() { f, err := excelize.OpenFile("Book1.xlsx") if err != nil { - println(err.Error()) + fmt.Println(err) return } // Insert a picture. if err := f.AddPicture("Sheet1", "A2", "image.png", ""); err != nil { - println(err.Error()) + fmt.Println(err) } // Insert a picture to worksheet with scaling. if err := f.AddPicture("Sheet1", "D2", "image.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`); err != nil { - println(err.Error()) + fmt.Println(err) } // Insert a picture offset in the cell with printing support. 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) } // Save the xlsx file with the origin path. 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.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index c81efd1..fa1dda9 100644 --- a/README.md +++ b/README.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.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index fa1dda9..821bbd7 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ## Introduction Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLSX files. Supports reading and writing XLSX file generated by Microsoft Excel™ 2007 and later. -Supports saving a file without losing original charts of XLSX. This library needs Go version 1.10 or later. The full API docs can be seen using go's built-in documentation tool, or online at [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) and [docs reference](https://xuri.me/excelize/). +Supports saving a file without losing original charts of XLSX. This library needs Go version 1.10 or later. The full API docs can be seen using go's built-in documentation tool, or online at [go.dev](https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc) and [docs reference](https://xuri.me/excelize/). ## Basic Usage -- 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.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 821bbd7..b3106df 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,7 @@ ## Introduction -Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLSX files. Supports reading and writing XLSX file generated by Microsoft Excel™ 2007 and later. -Supports saving a file without losing original charts of XLSX. This library needs Go version 1.10 or later. The full API docs can be seen using go's built-in documentation tool, or online at [go.dev](https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc) and [docs reference](https://xuri.me/excelize/). +Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLSX / XLSM / XLTM files. Supports reading and writing spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports complex components by high compatibility, and provided streaming API for generating or reading data from a worksheet with huge amounts of data. This library needs Go version 1.10 or later. The full API docs can be seen using go's built-in documentation tool, or online at [go.dev](https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc) and [docs reference](https://xuri.me/excelize/). ## Basic Usage @@ -24,6 +23,12 @@ Supports saving a file without losing original charts of XLSX. This library need go get github.com/360EntSecGroup-Skylar/excelize ``` +- If your package management with [Go Modules](https://blog.golang.org/using-go-modules), please install with following command. + +```bash +go get github.com/360EntSecGroup-Skylar/excelize/v2 +``` + ### Create XLSX file Here is a minimal example usage that will create XLSX file. -- cgit v1.2.1