Excelize is a library for manipulating Office Excel documents written in the Go language, based on the ECMA-376 OOXML Spec. It can be used to read and write XLSX files. Compared to other open source libraries, Excelize supports manipulating Excel with Pivottables, slicers, charts and images, inserting images into Excel and creating simple charts, and can be used in a variety of reporting systems.

Making: github.com/xuri/exceli…

On April 23, 2019, the community officially released version 2.0.0, which includes many new features, bug fixes, and performance optimizations. Here’s a summary of what’s been updated for this release, and a complete list of changes can be seen in the Change log.

Release Notes

The most significant changes in this release include:

API changes

The following table lists the API changes in V2.0.0 compared to v1.4.1:

The function name increaseerrorThe return value Line number calculation method changed* delete new
ToALphaString x x Square root x
TitleToNumber x x Square root x
SplitCellName x x x Square root
JoinCellName x x x Square root
ColumnNameToNumber x x x Square root
ColumnNumberToName x x x Square root
CellNameToCoordinates x x x Square root
CoordinatesToCellName x x x Square root
DuplicateRowTo x x x Square root
SetCellFloat x x x Square root
SetCellStyle Square root x x x
InsertCol Square root x x x
RemoveCol Square root x x x
RemoveRow Square root Square root x x
InsertRow Square root Square root x x
DuplicateRow Square root x x x
SetRowHeight Square root x x x
GetRowHeight Square root x x x
GetCellValue Square root x x x
GetCellFormula Square root x x x
GetCellHyperLink Square root x x x
SetCellHyperLink Square root x x x
SetCellInt Square root x x x
SetCellBool Square root x x x
SetCellStr Square root x x x
SetCellDefault Square root x x x
GetCellStyle Square root x x x
SetCellValue Square root x x x
MergeCell Square root x x x
SetSheetRow Square root x x x
SetRowVisible Square root Square root x x
GetRowVisible Square root Square root x x
SetRowOutlineLevel Square root Square root x x
GetRowOutlineLevel Square root Square root x x
GetRows Square root x x x
Columns Square root x x x
SearchSheet Square root x x x
GetPicture Square root x x x
AutoFilter Square root x x x
GetColVisible Square root x x x
SetColVisible Square root x x x
GetColOutlineLevel Square root x x x
SetColOutlineLevel Square root x x x
SetColWidth Square root x x x
GetColWidth Square root x x x
GetMergeCells Square root x x x
ProtectSheet Square root x x x
UnprotectSheet Square root x x x
UpdateLinkedValue Square root x x x
SetSheetVisible Square root x x x
adjustHelper Square root x x x
adjustMergeCells Square root x x x
adjustAutoFilter Square root x x x
prepareCell Square root x x x
setDefaultTimeStyle Square root x x x
timeToExcelTime Square root x x x
addDrawingChart Square root x x x
addDrawingVML Square root x x x
addDrawingPicture Square root x x x
getTotalRowsCols Square root x x x
checkRow Square root x x x
addDrawingShape Square root x x x
addTable Square root x x x
workSheetReader Square root x x x
copySheet Square root x x x

* As of version v2.0.0, all line manipulation methods use Excel line numbers starting from 1. The 0 based line numbers in some methods in earlier versions are no longer used, see related issue #349.

New features

  • new

DuplicateRowTo() method, which supports copying a specified row based on the given worksheet name (case sensitive) and row number

  • Worksheet page layout setting function

SetPageLayout() adds support for page layout orientation Settings, addressing issue #318

  • Worksheet page layout setting function

SetPageLayout() added support for page paper size Settings

The problem to repair

  • Fixed partial case where blank padding was created when cell color padding was not specified in style format
  • Fixed when worksheet data validation formula exceeds225A character problem when opening a file fails to resolve the correlation

issue #339

  • Fixed part of the case where deleting a cell with a formula would cause file corruption, addressing related issues

issue #346

  • Fix by getting the annotation function

GetComment(), which returns the wrong worksheet name when retrieving annotations from workbooks containing multiple worksheets, addresses issue #345

  • Fixed the function to get all cells of a worksheet

GetRows() returns the problem of redundant columns

  • Fixed document corruption caused by partially deleting worksheets containing formulas

Performance improvement

  • Cell assignment functions, add comments, pictures, charts, hyperlinks, and shape functions have all been significantly improved
  • New duplicate image check, will be used to add reference instead of adding duplicate image, solve the correlation

issue #359

The following figure shows the execution time and memory usage of the 12800 row 50 column worksheet under V1.4.1 and V2.0.0:

other

  • The contents of this document are updated and modified
  • Improved unit testing by adding unit testing under go1.12