diff --git a/LICENSE b/LICENSE index 4ca04b8..1ece21d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2016 - 2018 360 Enterprise Security Group, Endpoint Security, +Copyright (c) 2016 - 2019 360 Enterprise Security Group, Endpoint Security, inc. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 9d787d3..56f79e0 100644 --- a/README.md +++ b/README.md @@ -3,21 +3,17 @@

Build Status Code Coverage - Go Report Card GoDoc Licenses Donate

- -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize?ref=badge_large) - # Excelize ## Introduction -Excelize is a library written in pure Go and providing a set of functions that allow you to write to and read from XLSX files. Support reads and writes XLSX file generated by Microsoft Excel™ 2007 and later. Support save 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/). +Excelize is a library written in pure Go and providing a set of functions that allow you to write to and read from XLSX files. Support reads and writes XLSX file generated by Microsoft Excel™ 2007 and later. Support save 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/). ## Basic Usage @@ -178,4 +174,6 @@ Some struct of XML originally by [tealeg/xlsx](https://github.com/tealeg/xlsx). ## Licenses -This program is under the terms of the BSD 3-Clause License. See [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause). \ No newline at end of file +This program is under the terms of the BSD 3-Clause License. See [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause). + +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize?ref=badge_large) diff --git a/README_zh.md b/README_zh.md index 6be0f92..6fbbb00 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.8 或更高版本,完整的 API 使用文档请访问 [godoc.org](https://godoc.org/github.com/360EntSecGroup-Skylar/excelize) 或查看 [参考文档](https://xuri.me/excelize/)。 ## 快速上手 @@ -175,3 +175,5 @@ func main() { ## 开源许可 本项目遵循 BSD 3-Clause 开源许可协议,访问 [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 查看许可协议文件。 + +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2F360EntSecGroup-Skylar%2Fexcelize?ref=badge_large) diff --git a/cell.go b/cell.go index aa4067f..afe8635 100644 --- a/cell.go +++ b/cell.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/chart.go b/chart.go index fb7b60d..77a0125 100644 --- a/chart.go +++ b/chart.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/col.go b/col.go index 05405bd..af2c321 100644 --- a/col.go +++ b/col.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/comment.go b/comment.go index 9031aad..07f70b5 100644 --- a/comment.go +++ b/comment.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/datavalidation.go b/datavalidation.go index 5ebd61f..0a95251 100644 --- a/datavalidation.go +++ b/datavalidation.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/datavalidation_test.go b/datavalidation_test.go index e0d4a00..82bc42f 100644 --- a/datavalidation_test.go +++ b/datavalidation_test.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/date.go b/date.go index a0b8ceb..7dc5ef8 100644 --- a/date.go +++ b/date.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/excelize.go b/excelize.go index 35ff75a..60480c8 100644 --- a/excelize.go +++ b/excelize.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. diff --git a/excelize_test.go b/excelize_test.go index 1411371..1b6997a 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -129,6 +129,19 @@ func TestOpenFile(t *testing.T) { assert.NoError(t, xlsx.SaveAs("./test/TestOpenFile.xlsx")) } +func TestSaveFile(t *testing.T) { + xlsx, err := OpenFile("./test/Book1.xlsx") + if !assert.NoError(t, err) { + t.FailNow() + } + assert.NoError(t, xlsx.SaveAs("./test/TestSaveFile.xlsx")) + xlsx, err = OpenFile("./test/TestSaveFile.xlsx") + if !assert.NoError(t, err) { + t.FailNow() + } + assert.NoError(t, xlsx.Save()) +} + func TestSaveAsWrongPath(t *testing.T) { xlsx, err := OpenFile("./test/Book1.xlsx") if assert.NoError(t, err) { @@ -309,7 +322,7 @@ func TestGetCellHyperLink(t *testing.T) { link, target := xlsx.GetCellHyperLink("Sheet1", "") t.Log(link, target) - link, target = xlsx.GetCellHyperLink("Sheet1", "B19") + link, target = xlsx.GetCellHyperLink("Sheet1", "A22") t.Log(link, target) link, target = xlsx.GetCellHyperLink("Sheet2", "D6") t.Log(link, target) @@ -1082,7 +1095,7 @@ func TestInsertRow(t *testing.T) { func TestDuplicateRow(t *testing.T) { const ( - file = "./test/TestDuplicateRow" + + file = "./test/TestDuplicateRow" + ".%s.xlsx" sheet = "Sheet1" a1 = "A1" diff --git a/file.go b/file.go index 1f69005..3e49803 100644 --- a/file.go +++ b/file.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/lib.go b/lib.go index cf43dc9..99c513e 100644 --- a/lib.go +++ b/lib.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/picture.go b/picture.go index 9efd875..763d89a 100644 --- a/picture.go +++ b/picture.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/rows.go b/rows.go index def150d..cebedfa 100644 --- a/rows.go +++ b/rows.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/shape.go b/shape.go index ad87712..e2281a2 100644 --- a/shape.go +++ b/shape.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/sheet.go b/sheet.go index 1b0fe76..b03492c 100644 --- a/sheet.go +++ b/sheet.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/sheetpr.go b/sheetpr.go index 57eebd4..4497e7a 100644 --- a/sheetpr.go +++ b/sheetpr.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/sheetview.go b/sheetview.go index 37a0c39..6b191e9 100644 --- a/sheetview.go +++ b/sheetview.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/styles.go b/styles.go index f923787..d075266 100644 --- a/styles.go +++ b/styles.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/table.go b/table.go index 02c89fa..7c7e061 100644 --- a/table.go +++ b/table.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/templates.go b/templates.go index 1d0655d..17fc8d4 100644 --- a/templates.go +++ b/templates.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/vmlDrawing.go b/vmlDrawing.go index c17dde7..8b1d00f 100644 --- a/vmlDrawing.go +++ b/vmlDrawing.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlChart.go b/xmlChart.go index 2f9b8d9..163812d 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlComments.go b/xmlComments.go index 9075c88..5ffbecf 100644 --- a/xmlComments.go +++ b/xmlComments.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlContentTypes.go b/xmlContentTypes.go index 8d09d51..e99b0b3 100644 --- a/xmlContentTypes.go +++ b/xmlContentTypes.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlDecodeDrawing.go b/xmlDecodeDrawing.go index d21c3f0..eead575 100644 --- a/xmlDecodeDrawing.go +++ b/xmlDecodeDrawing.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlDrawing.go b/xmlDrawing.go index 7356cb5..89496c4 100644 --- a/xmlDrawing.go +++ b/xmlDrawing.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlSharedStrings.go b/xmlSharedStrings.go index 782ed61..3fcf3d5 100644 --- a/xmlSharedStrings.go +++ b/xmlSharedStrings.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlStyles.go b/xmlStyles.go index 7ba4379..fc53f77 100644 --- a/xmlStyles.go +++ b/xmlStyles.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlTable.go b/xmlTable.go index 7e155e6..6d27dc9 100644 --- a/xmlTable.go +++ b/xmlTable.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlTheme.go b/xmlTheme.go index b4140b6..01d0054 100644 --- a/xmlTheme.go +++ b/xmlTheme.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlWorkbook.go b/xmlWorkbook.go index 6572033..ad66f42 100644 --- a/xmlWorkbook.go +++ b/xmlWorkbook.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // diff --git a/xmlWorksheet.go b/xmlWorksheet.go index d35b40e..b3e8877 100644 --- a/xmlWorksheet.go +++ b/xmlWorksheet.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. //