Golang library for reading and writing Microsoft Excel™ (XLSX) files.

Overview

Excelize logo

Build Status Code Coverage Go Report Card go.dev Licenses Donate

Excelize

Introduction

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 and docs reference.

Basic Usage

Installation

go get github.com/360EntSecGroup-Skylar/excelize
  • If your packages are managed using Go Modules, please install with following command.
go get github.com/360EntSecGroup-Skylar/excelize/v2

Create spreadsheet

Here is a minimal example usage that will create spreadsheet file.

package main

import (
    "fmt"

    "github.com/360EntSecGroup-Skylar/excelize/v2"
)

func main() {
    f := excelize.NewFile()
    // Create a new sheet.
    index := f.NewSheet("Sheet2")
    // Set value of a cell.
    f.SetCellValue("Sheet2", "A2", "Hello world.")
    f.SetCellValue("Sheet1", "B2", 100)
    // Set active sheet of the workbook.
    f.SetActiveSheet(index)
    // Save spreadsheet by the given path.
    if err := f.SaveAs("Book1.xlsx"); err != nil {
        fmt.Println(err)
    }
}

Reading spreadsheet

The following constitutes the bare to read a spreadsheet document.

package main

import (
    "fmt"

    "github.com/360EntSecGroup-Skylar/excelize/v2"
)

func main() {
    f, err := excelize.OpenFile("Book1.xlsx")
    if err != nil {
        fmt.Println(err)
        return
    }
    // Get value from cell by given worksheet name and axis.
    cell, err := f.GetCellValue("Sheet1", "B2")
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.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")
        }
        fmt.Println()
    }
}

Add chart to spreadsheet file

With Excelize chart generation and management is as easy as a few lines of code. You can build charts based on data in your worksheet or generate charts without any data in your worksheet at all.

Excelize

package main

import (
    "fmt"

    "github.com/360EntSecGroup-Skylar/excelize/v2"
)

func main() {
    categories := map[string]string{
        "A2": "Small", "A3": "Normal", "A4": "Large",
        "B1": "Apple", "C1": "Orange", "D1": "Pear"}
    values := map[string]int{
        "B2": 2, "C2": 3, "D2": 3, "B3": 5, "C3": 2, "D3": 4, "B4": 6, "C4": 7, "D4": 8}
    f := excelize.NewFile()
    for k, v := range categories {
        f.SetCellValue("Sheet1", k, v)
    }
    for k, v := range values {
        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 {
        fmt.Println(err)
        return
    }
    // Save spreadsheet by the given path.
    if err := f.SaveAs("Book1.xlsx"); err != nil {
        fmt.Println(err)
    }
}

Add picture to spreadsheet file

package main

import (
    "fmt"
    _ "image/gif"
    _ "image/jpeg"
    _ "image/png"

    "github.com/360EntSecGroup-Skylar/excelize/v2"
)

func main() {
    f, err := excelize.OpenFile("Book1.xlsx")
    if err != nil {
        fmt.Println(err)
        return
    }
    // Insert a picture.
    if err := f.AddPicture("Sheet1", "A2", "image.png", ""); err != nil {
        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 {
        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 {
        fmt.Println(err)
    }
    // Save the spreadsheet with the origin path.
    if err = f.Save(); err != nil {
        fmt.Println(err)
    }
}

Contributing

Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change. XML is compliant with part 1 of the 5th edition of the ECMA-376 Standard for Office Open XML.

Licenses

This program is under the terms of the BSD 3-Clause License. See https://opensource.org/licenses/BSD-3-Clause.

The Excel logo is a trademark of Microsoft Corporation. This artwork is an adaptation.

gopher.{ai,svg,png} was created by Takuya Ueda. Licensed under the Creative Commons 3.0 Attributions license.

Comments
  • PR 366 Documentation

    PR 366 Documentation

    Description

    #366 Removed ToAlphaString, which is a breaking change, and replaced it with ColumnNumberToName. The documentation however, still has the original name in it. It also changed the signature from a string return value to a (string, error) return value to guard against indexes less than one. This doesn't seem necessary.

    It also appears to have changed the zero based index to a one based index. What was the motivation for these changes?

    Will there be a changelog that lays out other things that are now broken from that PR? It would be helpful to know what the upgrade path looks like.

    opened by mlh758 23
  • macOS can not use

    macOS can not use

    cell := xlsx.GetCellValue("Sheet1", "B2") fmt.Println(cell) // Get all the rows in a sheet. rows := xlsx.GetRows("sheet1") fmt.Println(rows)

    in windows it works normal,but in macOS rows is empty,cell can get value

    opened by a57571735 23
  • When Edit excel file,show warning

    When Edit excel file,show warning "发现“22.xlsx”中的部分内容有问题。是否让我们尽量尝试恢复? 如果您信任此工作簿的源,请单击“是”。"

    Description when edit the excel file with excelize , show the warning "发现“22.xlsx”中的部分内容有问题。是否让我们尽量尝试恢复? 如果您信任此工作簿的源,请单击“是"。"

    Steps to reproduce the issue:

    1. create a empty excel file,saved as "22.xlsx"

    2. use code edit it .

      f, _ := excelize.OpenFile("/Users/dev/Downloads/22.xlsx") f.SetActiveSheet(0) sheetName := f.GetSheetName(0) fmt.Println(sheetName) er := f.SetCellDefault(sheetName, "C4", "test") fmt.Println(er) f.Save()

    3. open the 22.xlsx file

    Describe the results you received:

    Describe the results you expected:

    Output of go version:

    go version go1.16.4 darwin/amd64
    

    Excelize version or commit ID:

    excelize 2.4.1
    

    Environment details (OS, Microsoft Excel™ version, physical, etc.): macOS Big Sur 11.4 Go 1.16.4 excelize 2.4.1 Excel 16.29(19090802)

    confirmed 
    opened by songxk 20
  • SetColStyle not honoring given style

    SetColStyle not honoring given style

    Description SetColStyle seems to be corrupting spreadsheets. It doesn't seem to matter what data is in the column or which column or sheet you use.

    I created this simple code to re-produce it:

    package main
    
    import (
    	"github.com/excelize"
    )
    
    // define globals
    
    var xlfile = "testlocal.xlsx"
    var xlsheetname = "test"
    
    // main
    func main() {
    	var (
    		file *excelize.File
    		err  error
    	)
    	// open the file
    	file, err = excelize.OpenFile(xlfile)
    	errorhandler(err)
    
    	err = file.SetColStyle(xlsheetname, "C", 7)
    	errorhandler(err)
    	file.Save()
    
    }
    
    func errorhandler(e error) {
    	if e != nil {
    		panic(e)
    	}
    }
    

    Steps to reproduce the issue:

    1. Create a spreadsheet named localtest.xlsx and a sheet named test
    2. run this test code against it
    3. open the spreadsheet and see it needs repair

    Describe the results you received: image Repair Log: `

    Repair Result to testlocal5.xml

    Errors were detected in file '/Users/stalt/Documents/go/src/setcoltest/testlocal.xlsx'Repaired Records: Column information from /xl/worksheets/sheet1.xml part

    `

    Describe the results you expected: I expect the column to be formated with

    Output of go version:

    $ go version
    go version go1.10 darwin/amd64
    

    Excelize version or commit ID:

    commit id: 448f552
    

    Environment details (OS, Microsoft Excel™ version, physical, etc.): macOS Mojave 10.14.5 Excel for Mac 16.27 (19071500)

    opened by SteveTalt 20
  • On same Exceltables different amount of columns detected

    On same Exceltables different amount of columns detected

    Hello on some excel tables i have a diffrenet amount of columns:

    https://imgur.com/a/s7TrBJK

    in this excel files i have different types of field. text, floats, urls, bools and so on. also stuff with commas and semicolons and this thing here -> '

    the file is imported from csv to excel and then save as xlsx. but i cant opet and work with excel in numbers or in excel so should not be an file error.

    thats how i read it... row, _ := file.GetRows(file.GetSheetName(0))

    opened by alemNative 19
  • after saving, file looks different

    after saving, file looks different

    1. open xlsx (quite complex formatting - styles and etc)
    2. copy from Col A into Col B
    3. set Col A equal 0
    4. save as a new file - files looks different :(

    some cells at each row can be merged, BUT Col A, and Col B are simple - only style formatting.

    More overs, some rows(quite a lot) that I'm not updating - after saving looks different.

    Let's recap - I only update some simple cells at some rows. Why rows that I'm not touching looks different?! :(

    opened by plandem 16
  •  Call GetSheetName can not get correct sheetname

    Call GetSheetName can not get correct sheetname

    Description

    GetSheetName can not get correct sheet name just return empty string

    Steps to reproduce the issue:

    1. my xlsx file's first sheet named "basic". so I call GetSheetIndex("basic") get return value is 15
    2. call GetSheetName(15) return value is "" (empty string)

    Describe the results you received: I get an empty string as sheetname

    Describe the results you expected: I expect the return string should be "basic"

    Output of go version:

    go version go1.11 linux/amd64
    

    Excelize version or commit ID:

    eef232f09ecd41b1f8fc199906ce0be64865802e
    

    Environment details (OS, Microsoft Excel™ version, physical, etc.):

    Ubuntu 18.04, wps 2019( can open and eidt excel 2007 xlsx file), thinkpad x1 carbon
    
    opened by virteman 15
  • Performance of large files is really bad

    Performance of large files is really bad

    I see your performance metrics in the docs but the files i'm dealing with can often be up to half a million rows.

    I'm importing from a CSV and as I continually SetCellValues processing each line, the performance of adding those lines gets worse and worse.

    	reader := csv.NewReader(csvBody)
    	const headerRow = 1
    	row := headerRow
    	var headers []string
    	rowstart := time.Now()
    	for {
    		line, err := reader.Read()
    		if err == io.EOF {
    			break
    		} else if err != nil {
    			log.Printf("Error Reading CSV: %+v ", err)
    			return err
    		}
    		if row == headerRow {
    			headers = line
    		}
    		for cellIndex, cellValue := range line {
    			if row > headerRow && stringInSlice(headers[cellIndex], []string{"quantity", "price"}) {
    				cellParsedValue, err := strconv.ParseFloat(cellValue, 64)
    				if err != nil {
    					log.Printf("%s\ncell %d in line %d had invalid value %s", err, cellIndex, row, cellValue)
    					return err
    				}
    				xlsx.SetCellValue("details", fmt.Sprintf("%s%d", excelize.ToAlphaString(cellIndex), row), cellParsedValue)
    			} else {
    				xlsx.SetCellValue("details", fmt.Sprintf("%s%d", excelize.ToAlphaString(cellIndex), row), cellValue)
    			}
    
    		}
    		pow10row := findPow10(row)
    		if row <= pow10row*10 && (row%pow10row == 0 || row%10000 == 0) {
    			elapsed := time.Since(rowstart)
    			log.Printf("Row %d, time elapsed %s", row, elapsed)
    			rowstart = time.Now()
    		}
    		row++
    	}
    

    Describe the results you received: In the log output below, each time elapsed is the difference from the previous log line. you can see that after about 10,000 rows, its starting to get really bad in terms of how long it takes to process each next 10,000 rows.

    2019/04/08 21:38:37 Row 1, time elapsed 1.505084ms
    2019/04/08 21:38:37 Row 2, time elapsed 96.097µs
    2019/04/08 21:38:37 Row 3, time elapsed 101.482µs
    2019/04/08 21:38:37 Row 4, time elapsed 94.35µs
    2019/04/08 21:38:37 Row 5, time elapsed 94.585µs
    2019/04/08 21:38:37 Row 6, time elapsed 96.621µs
    2019/04/08 21:38:37 Row 7, time elapsed 97.552µs
    2019/04/08 21:38:37 Row 8, time elapsed 99.631µs
    2019/04/08 21:38:37 Row 9, time elapsed 108.849µs
    2019/04/08 21:38:37 Row 10, time elapsed 74.078µs
    2019/04/08 21:38:37 Row 20, time elapsed 545.239µs
    2019/04/08 21:38:37 Row 30, time elapsed 513.501µs
    2019/04/08 21:38:37 Row 40, time elapsed 532.816µs
    2019/04/08 21:38:37 Row 50, time elapsed 564.326µs
    2019/04/08 21:38:37 Row 60, time elapsed 669.845µs
    2019/04/08 21:38:37 Row 70, time elapsed 1.508732ms
    2019/04/08 21:38:37 Row 80, time elapsed 666.172µs
    2019/04/08 21:38:37 Row 90, time elapsed 594.624µs
    2019/04/08 21:38:37 Row 100, time elapsed 630.948µs
    2019/04/08 21:38:37 Row 200, time elapsed 7.519094ms
    2019/04/08 21:38:37 Row 300, time elapsed 6.852758ms
    2019/04/08 21:38:37 Row 400, time elapsed 8.674476ms
    2019/04/08 21:38:37 Row 500, time elapsed 8.159781ms
    2019/04/08 21:38:37 Row 600, time elapsed 9.568621ms
    2019/04/08 21:38:37 Row 700, time elapsed 8.916284ms
    2019/04/08 21:38:37 Row 800, time elapsed 10.846477ms
    2019/04/08 21:38:37 Row 900, time elapsed 9.282789ms
    2019/04/08 21:38:37 Row 1000, time elapsed 12.92103ms
    2019/04/08 21:38:37 Row 2000, time elapsed 128.488664ms
    2019/04/08 21:38:37 Row 3000, time elapsed 189.107883ms
    2019/04/08 21:38:37 Row 4000, time elapsed 278.586948ms
    2019/04/08 21:38:38 Row 5000, time elapsed 391.341065ms
    2019/04/08 21:38:38 Row 6000, time elapsed 471.830863ms
    2019/04/08 21:38:39 Row 7000, time elapsed 530.416468ms
    2019/04/08 21:38:39 Row 8000, time elapsed 602.603427ms
    2019/04/08 21:38:40 Row 9000, time elapsed 652.277227ms
    2019/04/08 21:38:41 Row 10000, time elapsed 729.849772ms
    2019/04/08 21:38:52 Row 20000, time elapsed 10.977776474s
    2019/04/08 21:39:10 Row 30000, time elapsed 18.55464695s
    2019/04/08 21:39:37 Row 40000, time elapsed 26.336721766s
    2019/04/08 21:40:10 Row 50000, time elapsed 33.489274657s
    2019/04/08 21:40:51 Row 60000, time elapsed 40.729296603s
    2019/04/08 21:41:39 Row 70000, time elapsed 47.928431496s
    2019/04/08 21:42:34 Row 80000, time elapsed 55.148409674s
    2019/04/08 21:43:36 Row 90000, time elapsed 1m2.4532031s
    2019/04/08 21:44:46 Row 100000, time elapsed 1m9.608536367s
    2019/04/08 21:46:03 Row 110000, time elapsed 1m16.990387462s
    2019/04/08 21:47:27 Row 120000, time elapsed 1m24.146257207s
    2019/04/08 21:48:59 Row 130000, time elapsed 1m31.308584865s
    2019/04/08 21:50:37 Row 140000, time elapsed 1m38.654884213s
    2019/04/08 21:52:23 Row 150000, time elapsed 1m46.000199696s
    2019/04/08 21:54:16 Row 160000, time elapsed 1m53.238934707s
    2019/04/08 21:56:17 Row 170000, time elapsed 2m0.485714266s
    2019/04/08 21:58:25 Row 180000, time elapsed 2m7.897305904s
    2019/04/08 22:00:40 Row 190000, time elapsed 2m15.234462928s
    2019/04/08 22:03:03 Row 200000, time elapsed 2m23.134322152s
    2019/04/08 22:05:34 Row 210000, time elapsed 2m30.40930936s
    2019/04/08 22:08:11 Row 220000, time elapsed 2m37.873410076s
    2019/04/08 22:10:59 Row 230000, time elapsed 2m47.92659603s
    2019/04/08 22:13:58 Row 240000, time elapsed 2m58.625053178s
    2019/04/08 22:17:08 Row 250000, time elapsed 3m10.348595584s
    2019/04/08 22:20:29 Row 260000, time elapsed 3m20.726383957s
    2019/04/08 22:24:08 Row 270000, time elapsed 3m38.840478421s
    2019/04/08 22:28:12 Row 280000, time elapsed 4m4.294031488s
    2019/04/08 22:32:43 Row 290000, time elapsed 4m30.85305806s
    2019/04/08 22:37:45 Row 300000, time elapsed 5m2.183625905s
    2019/04/08 22:43:18 Row 310000, time elapsed 5m33.135633645s
    2019/04/08 22:49:22 Row 320000, time elapsed 6m3.47749514s
    2019/04/08 22:55:56 Row 330000, time elapsed 6m33.647828s
    2019/04/08 23:02:59 Row 340000, time elapsed 7m3.546443285s
    2019/04/08 23:10:35 Row 350000, time elapsed 7m35.978277292s
    2019/04/08 23:18:43 Row 360000, time elapsed 8m8.039533099s
    2019/04/08 23:27:22 Row 370000, time elapsed 8m38.447390938s
    2019/04/08 23:36:33 Row 380000, time elapsed 9m11.603785808s
    2019/04/08 23:46:15 Row 390000, time elapsed 9m41.515021912s
    2019/04/08 23:56:17 Row 400000, time elapsed 10m2.085553551s
    2019-04-09
    2019/04/09 00:06:42 Row 410000, time elapsed 10m25.252517462s
    2019/04/09 00:17:38 Row 420000, time elapsed 10m55.909756693s
    

    Describe the results you expected:

    if there was a direct way to import a CSV or some method to speed this sort of import up, it would be really useful

    Excelize version or commit ID:

      digest = "1:9b67e96a030cc96a3bef1d7cb1143f1e13440f1087eee5999fa9ba5514c1027c"
      name = "github.com/360EntSecGroup-Skylar/excelize"
      packages = ["."]
      pruneopts = ""
      revision = "dea7ba0ec43a4c29a6642d02b6edc73b8b0369f0"
      version = "v1.4.1"
    

    Environment details (OS, Microsoft Excel™ version, physical, etc.): The above log was captured from an AWS Fargate Docker task running with 4096 CPU units and 30720 MiB

    opened by jjmartin 15
  • Write to file as stream row by row?

    Write to file as stream row by row?

    Hi, would it be possible to have something like stream-writing to a file in case of lots of rows? Like hitting the excel sheet row limit?

    I'm not so familiar with GoLang's IO, but maybe there is no problem to achieve this?

    For example I have millions of rows to put in excel sheets, and it is obviously memory heavy task. The idea is to read slice of rows from data source, like 100,000 at the time, then write them to the excel file in a loop until all rows was written. In such case there would be produced either excel file with few sheets or few excel files.

    The primary idea is to handle memory consumption to reasonable amounts of RAM, like few gigabytes not tens..

    What's Your opinion?

    enhancement 
    opened by Ryouku 15
  • Corrupted xlsx after write operation

    Corrupted xlsx after write operation

    Thank you for your great work on excelize. Reading works like a charm. But I have an issue with writing.

    I update one cell, save and XLSX file is corrupted.

    Input file: source_file.xlsx Output corrupted file: Workbook.xlsx

    How I am writing to the file

    xlsx, err := excelize.OpenFile(path)
    xlsx.SetCellInt("Sheet1", "I15", 100)
    err := xlsx.SaveAs("./Workbook.xlsx")
    

    Erro message during opening Workbook.xlsx image

    And error if I try to recover the workbook: Replaced Part: /xl/worksheets/sheet1.xml part with XML error. Load error. Line 2, column 213397. Removed Records: Formula from /xl/calcChain.xml part (Calculation properties)

    go env

    set GOARCH=amd64
    set GOBIN=
    set GOEXE=.exe
    set GOHOSTARCH=amd64
    set GOHOSTOS=windows
    set GOOS=windows
    set GOPATH=C:\Users\stanislav.valasek\go
    set GORACE=
    set GOROOT=C:\Go
    set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
    set GCCGO=gccgo
    set CC=gcc
    set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
    set CXX=g++
    set CGO_ENABLED=1
    set CGO_CFLAGS=-g -O2
    set CGO_CPPFLAGS=
    set CGO_CXXFLAGS=-g -O2
    set CGO_FFLAGS=-g -O2
    set CGO_LDFLAGS=-g -O2
    set PKG_CONFIG=pkg-config
    
    opened by valasek 14
  • fix-save-to-file-as-stream

    fix-save-to-file-as-stream

    PR Details

    • Change the write method from writing to a bytes.Buffer to writing a stream to io.Writer

    Description

    • create a zip.Writer from io.Writer
    • for each components, create a new file then using a xml.Encoder() and write to io.Writer
    • using custom unmarshalXML to avoid using this block of code
    
    func replaceRelationshipsBytes(content []byte) []byte {
    	oldXmlns := []byte(`xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships`)
    	newXmlns := []byte("r")
    	return bytes.Replace(content, oldXmlns, newXmlns, -1)
    }
    

    Related Issue

    https://github.com/360EntSecGroup-Skylar/excelize/issues/487

    Motivation and Context

    improve performance and reduce memory for storing XML data

    How Has This Been Tested

    • writing a unit test for comparing custom unmarshal function and bytes.Replace result

    Types of changes

    • [ ] Docs change / refactoring / dependency upgrade
    • [] Bug fix (non-breaking change which fixes an issue)
    • [x] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to change)

    Checklist

    • [x] My code follows the code style of this project.
    • [ ] My change requires a change to the documentation.
    • [ ] I have updated the documentation accordingly.
    • [x] I have read the CONTRIBUTING document.
    • [x] I have added tests to cover my changes.
    • [x] All new and existing tests passed.
    size/XL 
    opened by ducquangkstn 12
  • CalcCellValue - don't evalutate correct value with Formula IF with other formula inside

    CalcCellValue - don't evalutate correct value with Formula IF with other formula inside

    Description

    Steps to reproduce the issue:

    1. in cell D142 value 2, in cell D143 value 1, in cell D144 value 1, in cell D145 value 2
    2. in cell E142 define formula =AVERAGE(D142:D145)/5
    3. in cell F142 define formula =IF(E142 > 0,4;"major";"minor")

    Describe the results you received: major Describe the results you expected: minor because the value in E142 is 0,3 Output of go version:

    go version go1.19.1 windows/amd64
    

    Excelize version or commit ID:

    b39626fae9c2aaa648259d412a67b67e7768ad17
    

    Environment details (OS, Microsoft Excel™ version, physical, etc.): Windows, Excel

    opened by alexvr8282 0
  • Fix panic in getSheetMap

    Fix panic in getSheetMap

    Add missing error checks in getSheetMap

    PR Details

    Missing error checks in getSheetMap

    Description

    Add error checks for getSheetMap

    Related Issue

    Motivation and Context

    There is no error checks, parser can crash on malformed input

    How Has This Been Tested

    Tested against a sample corrupted file

    Types of changes

    • [ ] Docs change / refactoring / dependency upgrade
    • [x] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to change)

    Checklist

    • [x] My code follows the code style of this project.
    • [ ] My change requires a change to the documentation.
    • [ ] I have updated the documentation accordingly.
    • [x] I have read the CONTRIBUTING document.
    • [x] I have added tests to cover my changes.
    • [x] All new and existing tests passed.
    size/S 
    opened by liron-l 1
  • CalcCellValue doesn't support function TEXT

    CalcCellValue doesn't support function TEXT

    Description

    Steps to reproduce the issue:

    1. in cell A1 input the value 0.05
    2. in cell A2 define the following formula =TEXT(A1, "0,0%")

    Describe the results you received: unsupported TEXT function

    Output of go version:

    go version go1.19.1 windows/amd64
    

    Excelize version or commit ID:

    b39626fae9c2aaa648259d412a67b67e7768ad17
    

    Environment details (OS, Microsoft Excel™ version, physical, etc.): Windows, Excel

    opened by alexvr8282 1
  • CalcCellValue doesn't work as expected with DATEVALUE

    CalcCellValue doesn't work as expected with DATEVALUE

    Description

    I'm using CalcCellValue in order to calculate the value previously set with the SetCellFormula. In this specific case, I am using a DATEVALUE formula. Basically, what I do is something like this:

    err = f.SetCellFormula(firstSheet, "K2", "DATEVALUE(\"2.7.2023\")"))
    if err != nil {
        logger.WithErr(err).Debug("SetCellFormula error")
        return nil, nil, err
    }
    
    cellValue, err = f.CalcCellValue(firstSheet, "K2")
    if err != nil {
        logger.WithErr(err).Debug("CalcCellValue error")
        return nil, nil, err
    }
    

    Describe the results you received:

    From the example above, I will always receive #VALUE! in the err.

    On the other side, I have also tried another simple example and this works as expected aka I receive 1 as a cellValue.

    err = f.SetCellFormula(firstSheet, "K2", "ABS(-1)")
    if err != nil {
        logger.WithErr(err).Debug("SetCellFormula error")
        return nil, nil, err
    }
    					
    cellValue, err = f.CalcCellValue(firstSheet, "K2")
    if err != nil {
        logger.WithErr(err).Debug("CalcCellValue error")
        return nil, nil, err
    }
    

    Is it possible there are some issues just with DATEVALUE or am I doing something wrong?

    Describe the results you expected:

    Instead of error (#VALUE!), I would expect 45109, which is the numeric value received after applying DATEVALUE on the 2.7.2023.

    image

    Output of go version:

    go version go1.19.3 darwin/arm6
    

    Excelize version or commit ID:

    ab12307393461e7055f664d296a3a0e686eebb39
    

    Environment details (OS, Microsoft Excel™ version, physical, etc.):

    MacOS, Excel 16.68

    opened by peric 1
  • picture insert style error

    picture insert style error

    Description when i try to insert more than three pictures in a cell, there is a style mixed in the cell, the third picture will fill the whole cell and the other left picture which are more than 3 their width would be 0

    Steps to reproduce the issue: 1. 2. 3.

    Describe the results you received:

    Describe the results you expected:

    Output of go version:

    (paste your output here)
    

    Excelize version or commit ID:

    (paste here)
    

    Environment details (OS, Microsoft Excel™ version, physical, etc.):

    needs more info 
    opened by zhujunjie-c 3
  • #1402 Get CountRows from sheet

    #1402 Get CountRows from sheet

    PR Details

    Get CountRows from sheet

    Description

    Get CountRows from sheet

    Related Issue

    https://github.com/qax-os/excelize/issues/1402

    Motivation and Context

    Current solutions are slow. My solution is fast.

    file 1М rows | - | - | - | |---|---|---| | BenchmarkFile_GetRows_Old-8 | 1 | 5797898958 ns/op | | BenchmarkFile_GetRows_New-8 | 3 | 411330472 ns/op |

    How Has This Been Tested

    Run test TestFile_CountRows

    Types of changes

    • [ ] Docs change / refactoring / dependency upgrade
    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [x] New feature (non-breaking change which adds functionality)
    • [x] Breaking change (fix or feature that would cause existing functionality to change)

    Checklist

    • [ ] My code follows the code style of this project.
    • [ ] My change requires a change to the documentation.
    • [ ] I have updated the documentation accordingly.
    • [ ] I have read the CONTRIBUTING document.
    • [ ] I have added tests to cover my changes.
    • [ ] All new and existing tests passed.
    size/L 
    opened by ivolkoff 0
Releases(v2.6.1)
  • v2.6.1(Aug 21, 2022)

    We are pleased to announce the release of version 2.6.1. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the changelog.

    Release Notes

    The most notable changes in this release are:

    Breaking Change

    • Rename exported type TabColor to TabColorRGB
    • Rename exported constant TotalColumns to MaxColumns
    • Rename exported variable ErrMaxFileNameLength to ErrMaxFilePathLength
    • Rename exported variable ErrWorkbookExt to ErrWorkbookFileFormat
    • Remove exported variable ErrEncrypt
    • Change worksheet name case-insensitive

    Notable Features

    • New support 34 formula functions: CONVERT, COVARIANCE.S, DAVERAGE, DAYS360, DCOUNT, DCOUNTA, DGET, DMAX, DMIN, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DVAR, DVARP, EDATE, EOMONTH, EUROCONVERT, GROWTH, HYPERLINK, MINVERSE, MMULT, NETWORKDAYS, NETWORKDAYS.INTL, PEARSON, RSQ, SKEW.P, SLOPE, STDEVPA, STEYX, TREND, WEEKNUM, WORKDAY, WORKDAY.INTL
    • New function DeleteComment support to delete comment, related issue #849
    • The AddShape function now support assigning a macro to the shape
    • Add support for the 1900 and 1904 date system, related issue #1212
    • Add support update cell hyperlink, related issue #1217
    • The AddPicture function now allowing insert EMF, WMF, EMZ and WMZ format images, related issue #1225
    • Make workbook open failed exception message clear, new exported variable ErrWorkbookPassword for the error message on receiving the incorrect workbook password
    • New exported constants MinFontSize, MinColumns and MaxCellStyles
    • Add array formula support for the formula calculation engine
    • Support for workbook encryption by password, related issue #199
    • RichTextRun support set superscript and subscript by vertAlign attribute
    • The DeleteDataValidation function support deleting all data validations in the worksheet, related issue #1254
    • Formula calculation engine support percentile symbol in condition criteria expression
    • Formula calculation engine support dependence formulas calculation, related issue #1262
    • Add export option MaxCalcIterations for specifies the maximum iterations for iterative calculation
    • Add export type ColorMappingType for color transformation types enumeration
    • Support adjust table range when removing and inserting column/row
    • Support set and get color index, theme and tint for sheet tab, related issue #1283
    • Add new export function GetRowOpts for rows iterator, to support get rows properties, related issue #1296

    Improve the Compatibility

    • Improve the compatibility with invalid internal styles count, resolve issue #1211
    • Improve the compatibility with Google Sheet, resolve issue #1244 and #1314
    • Stream writer now skips writing nil values when set cells value for the row, related issue #1299

    Bug Fixes

    • Fix generated file corrupted when the same field is used for pivot table data and rows/columns, resolve issue #1203
    • Fix get incorrect rich text value caused by missing cell type checking, resolve issue #1213
    • Fix incorrect cell data types casting results when number formatting, resolve issue #1219
    • Fix the read cell is empty when the cell is in 0 placeholder number format style, resolve issue #1312 and #1313
    • Fix set cell value with column and row style inherit issue, resolve issue #1163
    • Fix panic when adding pane on empty sheet views worksheet
    • Fix the problem of multi arguments formula calculation in some case
    • Fix generated file corrupted caused by incorrect worksheet header footer fields order, resolve issue #1257
    • Fix set cell value failed in some case, resolve issue #1264
    • Fix the panic when set or get sheet view options on the sheet without views options
    • Fix generated workbook corruption caused by empty created or modified dcterms in the document core properties
    • Fix doc properties missing after creating new worksheet, resolve issue #1298

    Performance

    • Improve performance for set sheet row and the merging cells, fix performance impact when resolving issue #1129
    • Optimization formula calculation performance
    • Reduces memory usage and speedup the AddComment function, resolve issue #1310

    Miscellaneous

    • The dependencies module has been updated
    • Unit tests and godoc updated, made the test case compatible with go1.19
    • Documentation website with multilingual: Arabic, German, Spanish, English, French, Russian, Chinese, Japanese, and Korean, which has been updated

    Thank you

    Thanks for all the contributors to Excelize. Below is a list of contributors that have code contributions in this version:

    • @JDavidVR (David)
    • @sceneq
    • @Juneezee (Eng Zer Jun)
    • @MichealJl (jialei)
    • @ww1516123
    • @z-hua (z.hua)
    • @xdlrt (yeshu)
    • @eaglexiang (Eagle Xiang)
    • @MJacred
    • @ReganYue (Regan Yue)
    • @thomascharbonnel (Thomas Charbonnel)
    • @ee0703 (EE)
    • @NaturalGao (NaturalGao)
    • @Sangua633
    Source code(tar.gz)
    Source code(zip)
  • v2.6.0(Apr 10, 2022)

    We are pleased to announce the release of version 2.6.0. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the changelog.

    Release Notes

    The most notable changes in this release are:

    Breaking Change

    • Rename exported constants NameSpaceDublinCoreMetadataIntiative to NameSpaceDublinCoreMetadataInitiative for typo fix
    • Rename exported variable ErrUnsupportEncryptMechanism to ErrUnsupportedEncryptMechanism
    • Rename exported variable ErrDataValidationFormulaLenth to ErrDataValidationFormulaLength
    • Rename exported variable ErrDefinedNameduplicate to ErrDefinedNameDuplicate
    • Remove exported variable XMLHeaderByte
    • Remove second useless parameter isCurrentSheet and error returns of the function SetSqrefDropList
    • Remove TotalRows of row iterator

    Notable Features

    • ProtectSheet now support protect sheet with specify algorithm: XOR, MD4, MD5, SHA1, SHA256, SHA384, and SHA512
    • UnprotectSheet now support specified the second optional password parameter to remove sheet protection with password verification
    • New support 71 formula functions: AVERAGEIFS, BETADIST, BETA.DIST, BETAINV, BETA.INV, BINOMDIST, BINOM.DIST, BINOM.DIST.RANGE, BINOM.INV, CHIINV, CHITEST, CHISQ.DIST, CHISQ.DIST.RT, CHISQ.INV, CHISQ.INV.RT, CHISQ.TEST, CONFIDENCE.T, CORREL, COVAR, COVARIANCE.P, CRITBINOM, ERROR.TYPE, EXPON.DIST, EXPONDIST, F.DIST, F.DIST.RT, FDIST, F.INV, F.INV.RT, FINV, FORMULATEXT, F.TEST, FTEST, GAMMA.DIST, GAMMADIST, GAMMA.INV, GAMMAINV, GAMMALN.PRECISE, GAUSS, HOUR, HYPGEOM.DIST, HYPGEOMDIST, INDIRECT, LOGINV, LOGNORM.DIST, LOGNORMDIST, LOGNORM.INV, MODE, MODE.MULT, MODE.SNGL, NEGBINOM.DIST, NEGBINOMDIST, PHI, SECOND, SERIESSUM, SUMIFS, SUMPRODUCT, SUMX2MY2, SUMX2PY2, SUMXMY2, T.DIST, T.DIST.2T, T.DIST.RT, TDIST, TIMEVALUE, T.INV, T.INV.2T, TINV, T.TEST, TTEST, TYPE
    • Check file extension on save the workbook
    • Support workbook views mode and ruler display settings
    • Improve number format support, introduced NFP (number format parser) dependencies module for custom dates and times number format and text place holder support, include local month name and AM/PM format in 19 languages (Afrikaans, Bangla, Chinese, English, French, German, Austria, Irish, Italian, Russian, Spanish, Thai, Tibetan, Turkish, Welsh, Wolof, Xhosa, Yi and Zulu) support for number format, related issues #660, #764, #1093, #1112, #1133
    • New exported functions SetWorkbookPrOptions and GetWorkbookPrOptions to support setting and getting the FilterPrivacy and CodeName properties of the workbook, resolve limitations when adding VBA project to the workbook, related issue #1148
    • Formula engine now support calculation with the none parameter formula function after infix operator notation
    • Support to read boolean data type cell value
    • Support set hole size when create the doughnut chart by AddChart function, resolve issue #1172
    • Export 4 errors ErrPasswordLengthInvalid, ErrUnsupportedHashAlgorithm, ErrUnsupportedNumberFormat, ErrWorkbookExt so users can act differently on the different type of errors

    Improve the Compatibility

    • Improve compatibility with LibreOffice, fixed the issue auto filter doesn't work on LibreOffice if the sheet name has spaces, resolve issue #1122
    • Improve the compatibility with alternate content, support preserve alternate content in the workbook, worksheet, and drawingML
    • Improve the compatibility with page setup DPI fields

    Bug Fixes

    • Fix missing page setup of worksheet after re-saving the spreadsheet, resolve issue #1117
    • Fix merged cells doesn't updated after opertaion in some cases
    • Fix style parsing issue, which causes bold and other style missing, resolve issue #1119
    • Fix file corrupted when save as in XLAM / XLSM / XLTM / XLTX extension in some case
    • Correct cells style in merge range, make cell support inheritance columns/rows style, resolve issue #1129
    • Fix incorrect style ID returned on getting cell style in some cases
    • Fix incorrect build-in number format: 42
    • Fixed parsing decimal precision issue in some case
    • SetCellDefault support non-numeric value, resolve issue #1139
    • Fixed show sheet tabs setting was missing on save as spreadsheet in some cases, resolve issue #1160
    • Fix nested formula calculation result error, resolve issue #1164
    • Fix a part of formula function calculation result precision issue and inconsistent result precision of formula calculation under x86 and arm64 processor (CPU) architecture
    • This fix scientific notation parsing issue in some case
    • Fix the issue that the chart axis maximum and minimum didn't work when the value is 0

    Performance

    • Improve streaming reading performance, based on the previously released version, reduce memory usage by about 50% at most for reading large data spreadsheet, and reduce 80% GC times for the row's iterator

    Miscellaneous

    • The dependencies module has been updated
    • Unit tests and godoc updated
    • Documentation website with multilingual: Arabic, German, Spanish, English, French, Russian, Chinese, Japanese, and Korean, which has been updated
    Source code(tar.gz)
    Source code(zip)
  • v2.5.0(Jan 2, 2022)

    We are pleased to announce the release of version 2.5.0. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the changelog.

    Release Notes

    The most notable changes in this release are:

    Breaking Change

    • Close spreadsheet and row's iterator required, the user should be close the stream after using the row's iterator, and close the spreadsheet after opening an existing spreadsheet
    • Change ReadZipReader as an implementation of the File, extract spreadsheet with given options, and support extract in memory or touching the filesystem
    • Remove unnecessary exported variable XMLHeader, we can using encoding/xml package's xml.Header instead of it
    • Remove unused exported error variable ErrToExcelTime

    Notable Features

    • New API: SetRowStyle support for set style for the rows, related issue #990
    • New API: GetCellType support for get the cell's data type, related issue #417 and #520
    • New API: SetAppProps and GetAppProps support to set and get document application properites, related issue #1095
    • GetCellValue, GetRows, GetCols, Rows and Cols support to specify read cell with raw value, related issue #621
    • New support 95 formula functions: ACCRINT, ACCRINTM, ADDRESS, AMORDEGRC, AMORLINC, AVEDEV, AVERAGEIF, CHIDIST, CONFIDENCE, CONFIDENCE.NORM, COUNTIF, COUNTIFS, COUPDAYBS, COUPDAYS, COUPDAYSNC, COUPNCD, COUPNUM, COUPPCD, DATEVALUE, DAY, DAYS, DELTA, DEVSQ, DISC, DURATION, ERF, ERF.PRECISE, ERFC, ERFC.PRECISE, GEOMEAN, GESTEP, IFNA, IFS, INDEX, INTRATE, ISFORMULA, ISLOGICAL, ISREF, ISOWEEKNUM, MATCH, MAXA, MAXIFS, MDURATION, MINIFS, MINUTE, MONTH, ODDFPRICE, PERCENTILE.EXC, PERCENTRANK.EXC, PERCENTRANK.INC, PERCENTRANK, PRICE, PRICEDISC, PRICEMAT, PV, QUARTILE.EXC, RANK, RANK.EQ, RATE, RECEIVED, RRI, SHEETS, SLN, STANDARDIZE, STDEV.P, STDEVP, SWITCH, SYD, TBILLEQ, TBILLPRICE, TBILLYIELD, TEXTJOIN, TIME, TRANSPOSE, TRIMMEAN, VALUE, VAR, VAR.S, VARA, VARPA, VDB, WEEKDAY, WEIBULL, WEIBULL.DIST, XIRR, XLOOKUP, XNPV, XOR, YEAR, YEARFRAC, YIELD, YIELDDISC, YIELDMAT, Z.TEST, ZTEST, related issue #1002
    • Formula calculation engine support nested calc for IF formula, related issue #987
    • Formula calculation engine support get shared formula, related issue #844
    • Formula calculation engine support text comparison, related issue #998
    • Support specify the formula in the data validation range, related issue #1012
    • Support specified unzip size limit on open file options, avoid zip bombs vulnerability attack
    • SetCellFormula now support set the shared formula
    • UpdateLinkedValue will skip macro sheet, related issue #1014
    • Fix AddPicture created duplicate image in some cases, caused by incorrect internal relationships ID calculation, related issue #1017
    • AddShape support set line width of add the shape, related issue #262
    • New options UnzipXMLSizeLimit have been added, support to specifies the memory limit on unzipping worksheet and shared string table in bytes
    • An error will be returned if given an invalid custom number format when creating a new style, related issue #1028
    • Now support set row style in the stream writer
    • Stream writer will create a time number format for time type cells, related issue #1107
    • Now support specify compact and outline for the pivot table, related issue #1029
    • Support get current rows/columns and total rows/columns in the stream reader, related PR #1054
    • Now support time zone location when set cell value, related issue #1069
    • Export 7 errors so users can act differently on different type of errors

    Improve the Compatibility

    • Improve compatibility with row element with r="0" attribute
    • Preserve XML control character
    • Improve the compatibility of style settings with Apple Numbers, related issue #1059
    • Support multi-byte language on set header footer, related issue #1061
    • Preserve horizontal tab character when set the cell value, related issue #1108

    Bug Fixes

    • Fix the data validation deletion failed, resolve issue #979
    • Fix set data validation drop list failed in some cases, resolve issue #986
    • Fix formula calculation engine LOOKUP doesn't handle array form correctly, resolve issue #994
    • Fix formula calculation engine LOOKUP can only find exact match, resolve issue #997
    • Fix formula percentages calculated incorrectly, resolve issue #993
    • Fix panic caused by incorrect cell read on some case
    • Fix conditional format bottom N not working
    • Fix time parse accuracy issue, resolve issue #1026 and #1030
    • Fix build-in scientific number format failed, resolve issue #1027
    • Fix small float parse error in some case, resolve issue #1031
    • Fix worksheet deletion failed in some case
    • Fix build-in time number format parse error, resolve issue #1060
    • Fix NewStyle returned incorrect style ID in some case
    • Fix merged cell range error after row/column insert/deletion in some corner case

    Performance

    • Merge cell time cost speed up, based on the previously released version time cost decrease over 90%
    • Improve streaming reading performance, unzip shared string table to system temporary file when large inner XML, based on the previously released version, memory usage decreased about 60% at most, related issue #1096
    • Worksheet list read speed up
    • Merge column styles to reduce spreadsheet size, resolve issue #1057

    Miscellaneous

    • The dependencies module has been updated
    • Unit tests and godoc updated
    • Documentation website with multilingual: Arabic, German, Spanish, English, French, Russian, Chinese, Japanese, and Korean, which has been updated
    Source code(tar.gz)
    Source code(zip)
  • v2.4.1(Aug 1, 2021)

    We are pleased to announce the release of version 2.4.1. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the changelog.

    Release Notes

    The most notable changes in this release are:

    Breaking Change

    Change Go Modules import path to github.com/xuri/excelize/v2

    Notable Features

    • Support set column width in streaming mode, related issue #625
    • Support merge cell in streaming mode, related issue #826
    • New support 2 formula functions: BESSELK, BESSELY
    • The formula calculation engine now supports defined name references
    • Add disable option for chart xAxis and yAxis
    • The function AddPivotTable support reference source data range by defined name, relate issue #856
    • The following function now is concurrency safety, relate issue #861
    • Export 24 function's error message

    Improve the Compatibility

    • Improves compatibility for default XML namespace attributes, fix generated corrupted file in some case
    • Improves compatibility with non-standard page setup attributes, fix open spreadsheet failed in some case
    • Add count attribute in shared strings table
    • Remove UTC timezone requirement when setting cell value with time, related issue #409
    • Improves compatibility with XML control character in the escape literal string
    • Rename exported field File.XLSX to File.Pkg
    • Change the sheet names are not case sensitive for NewSheet, GetSheetIndex, DeleteSheet, resolve issue #873
    • Fix missing pivot attribute of conditional formatting, resolve issue #883
    • Improvement compatibility with invalid first-page number attribute in the page layout
    • Add maximum character limit and fix missing preserve character for SetCellRichText

    Bug Fixes

    • Fix 12/24 hours time format parsing error, resolve issue #823 and #841
    • Fix can't get comments by GetComments in some case, resolve issue #825
    • Fix issue when get and add comments on multi authors, resolve issue #829 and #830
    • Fix invalid file path and duplicate namespace when re-creating worksheet, resolve issue #834
    • Fix set outline attributes not work when the value of showOutlineSymbols, summaryBelow and summaryRight attributes are false
    • Avoid empty rows in the tail of the worksheet by GetRows, resolve issue #842
    • Fix missing formula cell when getting rows value, resolve issue #855
    • Fix comparison fails inside and outside IF function, resolve issue #858
    • Fix GetRowHeight actually get the height of the next row
    • Fix incorrect scope when getting and delete the defined name, resolve issue #879
    • Attribute LocalSheetID in the defined name should be equal to SheetIndex instead of SheetID
    • Fix missing set each cell's styles when set columns style, resolve issue #467
    • Prevent panic when an incorrect range is provided as PivotTableRange on creating a pivot table
    • Fix reading decimals precision issue, resolve issue #848 and #852
    • Escape XML character in the drop list, avoid corrupted file generated, resolve issue #971
    • Fix incorrect character count limit in the drop list, resolve issue #972
    • Fix high CPU usage on reading cell value with number format caused by Excel time parse issue in some case, resolve issue #974
    • Fix month parsing error in custom number format in some cases

    Performance

    • Reduce memory usage Save and SaveAs about 19% at most based on the previously released version

    Miscellaneous

    • Fix code security issue CWE-190 and CWE-681
    • The dependencies module has been updated
    • Unit tests and godoc updated
    • Use GitHub Action for unit testing
    • Documentation website with multilingual: Arabic, German, Spanish, English, French, Russian, Chinese, Japanese, and Korean, which has been updated
    Source code(tar.gz)
    Source code(zip)
  • v2.4.0(Apr 18, 2021)

    We are pleased to announce the release of version 2.4.0. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the changelog.

    Release Notes

    The most notable changes in this release are:

    Breaking Change

    Upgrade requirements Go language version is 1.15 or later.

    Notable Features

    • New API GetCellRichText support to get the rich text of cell by given worksheet
    • Now support to set and get: print scaling, print black and white, and specified the first printed page number of the worksheet by SetPageLayout and GetPageLayout
    • Now support to change and get tab color of the worksheet by SetSheetPrOptions and GetSheetPrOptions
    • SetCellHyperlink now support to set hyperlink display & tooltips text, related issue #790
    • Support ShowError option when adding the pivot table
    • Support setting formula for cell in streaming API, related issue #625
    • The formula calculation engine now supports not equal operator
    • The nested formula function now supports cell references as arguments
    • Support to specifies that each data marker in the series has a different color
    • New support 152 formula functions: ATAN, AVERAGE, AVERAGEA, BESSELI, BESSELJ, BIN2DEC, BIN2HEX, BIN2OCT, BITAND, BITLSHIFT, BITOR, BITRSHIFT, BITXOR, CHAR, CHOOSE, CLEAN, CODE, COLUMN, COLUMNS, COMPLEX, CONCAT, CONCATENATE, COUNT, COUNTBLANK, CUMIPMT, CUMPRINC, DATE, DATEDIF, DB, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DOLLARDE, DOLLARFR, EFFECT, ENCODEURL, EXACT, FALSE, FIND, FINDB, FISHER, FISHERINV, FIXED, FV, FVSCHEDULE, GAMMA, GAMMALN, HARMEAN, HEX2BIN, HEX2DEC, HEX2OCT, HLOOKUP, IF, IFERROR, IMABS, IMAGINARY, IMARGUMENT, IMCONJUGATE, IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMDIV, IMEXP, IMLN, IMLOG10, IMLOG2, IMPOWER, IMPRODUCT, IMREAL, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN, IPMT, IRR, ISTEXT, ISPMT, KURT, LARGE, LEFT, LEFTB, LEN, LENB, LOOKUP, LOWER, MAX, MID, MIDB, MIN, MINA, MIRR, N, NOMINAL, NORM.DIST, NORMDIST, NORM.INV, NORMINV, NORM.S.DIST, NORMSDIST, NORM.S.INV, NORMSINV, NOT, NOW, NPER, NPV, OCT2BIN, OCT2DEC, OCT2HEX, PDURATION, PERCENTILE.INC, PERCENTILE, PERMUT, PERMUTATIONA, PMT, POISSON.DIST, POISSON, PPMT, PROPER, QUARTILE, QUARTILE.INC, REPLACE, REPLACEB, REPT, RIGHT, RIGHTB, ROMAN, ROW, ROWS, SHEET, SKEW, SMALL, STDEV, STDEV.S, STDEVA, SUBSTITUTE, T, TODAY, TRIM, TRUE, UNICHAR, UNICODE, UPPER, VAR.P, VARP, VLOOKUP

    Improve the Compatibility

    • Now set the empty string for the cell when SetCellValue with nil, resolve issue #756
    • Remove useless internal XML omitempty tag on style pattern fill color
    • Fix compatibility issue of Google Sheets offline browser extension #769
    • Use absolute reference in the auto filters defined name to make it compatible with OpenOffice, resolve issue #776
    • Handle end element event in the worksheet row/column iterator XML SAX parser, faster row/column iterate and fix inconsistent read rows count of the file in some case
    • Improves compatibility for worksheet relative XML path
    • Avoid duplicate rich text string items #787
    • Improves compatibility for absolute XML path, Windows-style directory separator, and inline namespace

    Bug Fixes

    • Fix round precision issue #764
    • Add missing fields and change the order of the fields of workbook fields, prevent generate the corrupted file in some case, resolve issue #766
    • Fix hyperbolic cotangent calculation incorrect
    • Correct adjust calculation chain in duplicate rows, resolve issue #774
    • Correct adjust defined name in the workbook when deleting a worksheet, resolve issue #775
    • Fix cyclomatic complexity issue of internal function newFills and parseToken
    • Fix custom row height check issue
    • Fix unmerge all cells cause corrupted file, resolve issue #782
    • Fix part of auto filter rules missing after saved
    • Fix UpdateLinkedValue which returns an error when has chart sheet or dialog sheet
    • Fix incorrect default column from GetColWidth in some case
    • Fix can't add timelines and slicers for a pivot table in a generated spreadsheet, resolve issue #804
    • Fix incorrect SetDefinedName's localSheetId attribute to use sheetIndex
    • Fix missing cell locked or hidden protection in some case, resolve issue #809
    • Fix streaming data writer result missing after call normal API, resolve issue #813
    • Fix the negative values series missing chart color issue

    Performance

    • Faster numeric precision process

    Miscellaneous

    • The dependencies module has been updated
    • Unit tests and godoc updated
    • Documentation website with multilingual: Arabic, German, Spanish, English, French, Russian, Chinese, Japanese, and Korean, which has been updated
    • Welcome join the Slack channel or Telegram Group to meet other members of our community
    Source code(tar.gz)
    Source code(zip)
  • v2.3.2(Jan 3, 2021)

    We are pleased to announce the release of version 2.3.2. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the changelog.

    Release Notes

    The most notable changes in this release are:

    Notable Features

    • The function AddPivotTable now support none-column and multi-data fields, relate issue #710
    • The function GetCellValue support custom date-time number format, relate issue #703
    • The function CalcCellValue now support new formula function AND, CLEAN, TRIM, LOWER, PROPER, UPPER and OR, relate issue #701 and #747
    • The range of data validation now supports float decimal, relate issue #739
    • The function AddChart now support to set marker type and custom line width, relate issue #549 and #657

    Improve the Compatibility

    • Improve over 6 series line chart compatibility with KingSoft WPS™, resolve #627
    • Avoid creating duplicate inner style in some case
    • Parse document core part (workbook) dynamically
    • Support single line with repeated row element in the worksheet data, resolve #732

    Bug Fixes

    • Prevent formula lexer panic on retrieving the top token type on some invalid formula, resolve issue #711
    • Fix missing worksheet when renaming with same names, resolve issue #713
    • Fix wrong worksheet index returned by NewSheet in some cases, resolve issue #714
    • Fix panic on formatted value with no built-in number format ID, resolve issue #715 and #741
    • Rounding numeric with precision for formula calculation, resolve issue #727
    • Fix row duplicate mechanism #729
    • Fix incorrect active tab after delete worksheet in some cases, resolve issue #735
    • Fix AddPicture autofit failure with multi merged cells, resolve issue #748

    Performance

    • Stream writing memory usage decrease about 60%, relate issue #659
    • Optimize memory allocation workSheetWriter, relate issue #722
    • Improve AddPicture performance, relate issue #706

    Miscellaneous

    • Unit tests and godoc updated
    • Documentation website with multilingual: English, French, Russian, Chinese, Japanese, and Korean, which has been updated, 3 new language: Arabic, German and Spanish language version docs published
    • Welcome join the Slack channel or Telegram Group to meet other members of our community
    Source code(tar.gz)
    Source code(zip)
  • v2.3.1(Sep 22, 2020)

    We are pleased to announce the release of version 2.3.1. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the changelog.

    Release Notes

    The most notable changes in this release are:

    Notable Features

    • Support open spreadsheet with password protection by ECMA-376 document standard encryption, relate issue #199
    • Add checking and limits for the worksheet
    • Extend pivot table functionality: support set the header, style, and table options for the pivot table
    • Security vulnerabilities and patches

    Improve the Compatibility

    • Compatible with Go 1.15, fix unit test failed on Windows and potential race condition, relate issue #689
    • Default row height compatibility with Apache OpenOffice and Kingsoft WPS™
    • Improve compatibility for the phonetic hint and sheet tab color

    Bug Fixes

    • Fix RemoveRow slice bounds out of range cause panic in some case, resolve #686
    • Fix stream writer generated corrupted files issue
    • Fix the scale for add picture not work, resolve #691

    Miscellaneous

    • Unit tests update and typo fixed
    • Documentation website with multilingual: English, French, Russian, Chinese, Japanese, and Korean, which has been updated
    • Welcome join the Slack channel to meet other members of our community
    Source code(tar.gz)
    Source code(zip)
  • v2.3.0(Aug 9, 2020)

    We are pleased to announce the release of version 2.3.0. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the changelog.

    Release Notes

    The most notable changes in this release are:

    Notable Features

    • Support to set cell values concurrent, relate issue #670
    • New API: SetSheetFormatPr and GetSheetFormatPr, support to set and get worksheet formatting properties, relate issue #635
    • New API: GetCols and Cols, support columns iterator
    • AddChart support specified logarithmic scale on Y-axis, relate issue #661
    • AddPicture support insert image autofit cell
    • Add limits for total columns, row and filename length
    • Formula calculation engine support defined name, relate issue #665
    • API CalcCellValue update, formula calculation engine working in progress: 12 new functions has been added, COUNTA, ISBLANK, ISERR, ISERROR, ISEVEN, ISNA, ISNONTEXT, ISODD, ISNUMBER, MEDIAN, NA, SUMIF

    Improve the Compatibility

    • Compatible to case-sensitive doc parts path
    • Storage string to SST (shared string table), relate issue #622
    • Support the row element without r attribute in the worksheet
    • Support XML multi namespace, make compatible with Kingsoft WPS™ Office, relate issue #651
    • Improve the compatibility of the auto filter with Office 2007 - 2010, resolve #637

    Bug Fixes

    • Avoid duplicate filter database in workbook defined name
    • Avoid creating duplicate style, resolve #643
    • Escape characters for set rich-text
    • Fix the issue, comment shapes are changed after reopening spreadsheet created by Excelize, resolve #672
    • Fix panic when enabling compiler inline flags, resolve #677 and #679
    • Fix the accuracy issue of getting cell value of percentage cell

    Miscellaneous

    • Improved error handling and fix crash when open invalid spreadsheet file
    • Add missing checking error in unit tests
    • Documentation website with multilingual: English, French, Russian, Chinese, Japanese, and Korean, which has been updated
    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(May 10, 2020)

    We are pleased to announce the release of version 2.2.0. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the changelog.

    Release Notes

    The most notable changes in this release are:

    Notable Features

    • Using the worksheet index instead of ID in the following functions: GetSheetName, GetSheetIndex, GetActiveSheetIndex and SetActiveSheet, relate issue #485
    • New function GetSheetList to get the worksheet, chart sheet, and dialog sheet name list of the workbook
    • New function AddChartSheet support create chart sheet, relate issue #451
    • New function UnsetConditionalFormat, support for remove conditional format, relate issue #571
    • New function DeleteDataValidation, support delete data validation, relate issue #348
    • New function SetCellRichText, support set rich text, relate issue #172
    • New functions InsertPageBreak and RemovePageBreak, support for insert and remove page break, relate issue #492
    • The AddPivotTable API changed, support for setting date field subtotal and names of the pivot table, relate issue #582
    • The AddPivotTable support to set the filter for the pivot table, relate issue #598
    • The AddPivotTable allow empty filter, data, and rows in the pivot table
    • Export ExcelDateToTime function to convert excel date to time
    • Export Style structs to allow create the style for cells by given JSON or structure pointer, relate issue #470

    Bug Fixes

    • Fix greaterThanOrEqual and lessThanOrEqual operators did not work when setting the conditional format for cell by SetConditionalFormat, resolve issue #608
    • Fix corrupt worksheet created by StreamWriter, resolve issue #576
    • Escape character in the formula, resolve issue #578
    • Fix the DuplicateRowTo function doesn't duplicate merged cells, resolve issue #586
    • Fix conditional formatting hides the adjacent borders by ignoring empty conditional format style, resolve issue #200
    • Fix missing comments by GetComments, resolve issue #345
    • Fix reading wrong string by GetCellValue in some case, resolve issue #602
    • Check and fill the cell without r attribute in a row element, fix returned empty value when GetCellValue in some case
    • Allow empty or default cell style formats, resolve #628

    Performance

    • Reduce redundant memory copy in getRowHeight

    Miscellaneous

    • Remove calculated properties to make recalculate formulas in some spreadsheet applications, such as Kingsoft WPS™ Office
    • Add missing checking error in unit tests
    • Documentation website with multilingual: English, French, Russian, Chinese, Japanese, and Korean, which has been updated
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Feb 9, 2020)

    We are pleased to announce the release of version 2.1.0. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the changelog.

    Release Notes

    The most notable changes in this release are:

    Notable Features

    • New function DeleteDefinedName, support to delete the defined names of the workbook or worksheet
    • New functions SetPageMargins and GetPageMargins, support to for getting setting page margins
    • New functions DeleteChart and DeletePicture, support to delete chart and images from the worksheet
    • Add support for Excel file that uses no UTF-8 encoding
    • The function AddChart now support to create the pie of pie chart, the bar of pie chart and combo chart The function AddChart now support to set minor grid lines for the chart, relate issue #501 The function AddChart now support to set line width of the line chart, relate issue #505 The function AddChart now support to set a major unit and tick label skip for the chart, relate issue #538
    • The function SetColVisible now support to set column visible by column range
    • The function AddPivotTable allow empty columns in the pivot table, relate issue #511

    Bug Fixes

    • Fix missing ending space text of the cell
    • The MergeCell function support overlapped merge cells, resolve issue #533
    • Added handling of empty inline rich text in some case, resolve issue #529
    • Added handling of empty workbook view in some case, resolve issue #426
    • Added handling of escape character in the formula, resolve issue #546

    Performance

    • New functions NewStreamWriter and Flush to generate the new worksheet with huge amounts of data. Compared to non-streaming writing, reduced memory usage by 90.2%, time cost by 53%
    • Make GetRows function read data as streaming. Reduced memory usage by 78.9%, relate issues #146 and #382
    • Compatibility improvements, adding 49 internal XML namespaces support

    Miscellaneous

    • Added logging of possible errors when decoding XML, relate issues #539
    • Improve code coverage unit tests (line Coverage: 97.04%)
    • Add missing checking error in unit tests
    • Documentation website with multilingual: English, French, Russian, Chinese, Japanese, and Korean, which has been updated
    Source code(tar.gz)
    Source code(zip)
  • v2.0.2(Oct 9, 2019)

    We are pleased to announce the release of version 2.0.2. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the change log.

    Release Notes

    The most notable changes in this release are:

    Breaking Change

    Upgrade requirements Go language version is 1.10 or later.

    Notable Features

    • Create pivot table support. New function AddPivotTable() has been added
    • Create sparkline support. New function AddSparkline() has been added
    • New function GroupSheets() and UngroupSheets() support group and ungroup sheets
    • New function AddVBAProject() to support add vbaProject.bin file which contains functions and/or macros
    • The function SetPageLayout() now support to support to set fit to width and height, relate issue #432
    • The function SetSheetViewOptions() support to set whether to "show a zero in cells that have zero value" now
    • Allow access to more formula attributes in SetCellFormula(), support set the type of the formula and the ref attribute
    • Font strike style support, relate issue #482

    Bug Fixes

    • Fix missing text of comments in some case, resolve issue #434
    • Fix RemoveRow() out of range in some case by recalculate offset for merged cells adjuster, resolve issue #437
    • Fix invalid formula in data validation drop list
    • Fix file corrupted when calling the Save() method in the iteration, resolve issue #443
    • Compatible with different types of relative paths in workbook.xml.rels to fix read file failed in some case, resolve issue #442
    • Fixed file corruption when deleting all merged cells in some case
    • Fix issue where the protection worksheet settings are invalid in some case, resolve issue #454
    • Fix GetSheetName doesn't work in some case by check the sheets list based on index instead, resolve issue #457
    • Add multi-row inline strings support, relate issue #464
    • Fix overflow numeric cell value on the 32-bit operating system, relate issue #386
    • Fix go module dependency errors, relate issue #466 and #480
    • Fix file corrupted when calling SetSheetPrOptions() in some case, resolve issue #483

    Performance

    • Performance optimization, faster for reading the file, relate issue #439

    Miscellaneous

    • Add missing error check in SetSheetRow()
    • Optimize code, combine internal functions: workBookRelsWriter, drawingRelsWriter into relsWriter; drawingRelsReader, workbookRelsReader, workSheetRelsReader into relsReader addDrawingRelationships, addSheetRelationships into addRels
    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Jun 30, 2019)

    We are pleased to announce the release of version 2.0.1. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the change log.

    Release Notes

    The most notable changes in this release are:

    Notable Features

    • New function SetHeaderFooter() init set header and footer support, relate issue #394
    • New function SetColStyle() support to set style by columns, relate issue #397
    • New functions SetDefaultFont() and GetDefaultFont() support to change the default font, relate issue #390
    • New functions SetDocProps() and GetDocProps(), support to set and get doc properties, relate issue #415
    • The function AddChart() now support to create new 26 types of chart: cone, pyramid and cylinder series chart for column and bar, surface 3D, wireframe Surface 3D, contour and wireframe contour,bubble and a 3D bubble chart, unsupported chart type add error prompt
    • New functions SetDefinedName() and GetDefinedName() support to set and get defined names
    • More detailed error information when open the encrypted file
    • The function AddPicture() now support to add TIF and TIFF format images

    Bug Fixes

    • Fix structs fields definition errors and keep double quotes in data validation formula
    • Fix comments duplicate caused by inner counting errors, resolve issue #373
    • Fix read file error caused by getting sheet map errors, resolve issue #404
    • Enhance compatibility with PivotTable, resolve issue #413
    • Enhance compatibility with font size and a bold style, resolve issue #411, #420, and #425
    • Enhance recalculation adjuster to resolve file broken issue, after insert or remove rows in some case, relate issue #421 and #424
    • Fix hide sheet does not work in some case, relate issue #418
    • Fix multi-chart series caused file corrupted by avoid accent theme color index overflow, relate issue #422

    Miscellaneous

    • Improve unit testing coverage (Line Coverage: 96.05%)
    • Optimize code, fix golint issues
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(May 2, 2019)

    We are pleased to announce the release of version 2.0.0. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the change log.

    Release Notes

    The most notable changes in this release are:

    Breaking Change

    The following table lists the changes to the functions for v2.0.0 compared to the v1.4.1:

    |Function|Add error return|Row Number Change*|Delete|New Addition| |---|---|---|---|---| |ToALphaString|×|×|√|×| |TitleToNumber|×|×|√|×| |SplitCellName|×|×|×|√| |JoinCellName|×|×|×|√| |ColumnNameToNumber|×|×|×|√| |ColumnNumberToName|×|×|×|√| |CellNameToCoordinates|×|×|×|√| |CoordinatesToCellName|×|×|×|√| |SetCellFloat|×|×|×|√| |SetCellStyle|√|×|×|×| |InsertCol|√|×|×|×| |RemoveCol|√|×|×|×| |RemoveRow|√|√|×|×| |InsertRow|√|√|×|×| |DuplicateRow|√|×|×|×| |DuplicateRowTo|√|×|×|×| |SetRowHeight|√|×|×|×| |GetRowHeight|√|×|×|×| |GetCellValue|√|×|×|×| |GetCellFormula|√|×|×|×| |GetCellHyperLink|√|×|×|×| |SetCellHyperLink|√|×|×|×| |SetCellInt|√|×|×|×| |SetCellBool|√|×|×|×| |SetCellStr|√|×|×|×| |SetCellDefault|√|×|×|×| |GetCellStyle|√|×|×|×| |SetCellValue|√|×|×|×| |MergeCell|√|×|×|×| |SetSheetRow|√|×|×|×| |SetRowVisible|√|√|×|×| |GetRowVisible|√|√|×|×| |SetRowOutlineLevel|√|√|×|×| |GetRowOutlineLevel|√|√|×|×| |GetRows|√|×|×|×| |Columns|√|×|×|×| |SearchSheet|√|×|×|×| |GetPicture|√|×|×|×| |GetColVisible|√|×|×|×| |SetColVisible|√|×|×|×| |GetColOutlineLevel|√|×|×|×| |SetColOutlineLevel|√|×|×|×| |SetColWidth|√|×|×|×| |GetColWidth|√|×|×|×| |GetMergeCells|√|×|×|×| |ProtectSheet|√|×|×|×| |UnprotectSheet|√|×|×|×| |UpdateLinkedValue|√|×|×|×| |SetSheetVisible|√|×|×|×| |adjustHelper|√|×|×|×| |adjustMergeCells|√|×|×|×| |adjustAutoFilter|√|×|×|×| |prepareCell|√|×|×|×| |setDefaultTimeStyle|√|×|×|×| |timeToExcelTime|√|×|×|×| |addDrawingChart|√|×|×|×| |addDrawingVML|√|×|×|×| |addDrawingPicture|√|×|×|×| |getTotalRowsCols|√|×|×|×| |checkRow|√|×|×|×| |addDrawingShape|√|×|×|×| |addTable|√|×|×|×| |workSheetReader|√|×|×|×| |copySheet|√|×|×|×|

    * From version 2.0.0 all row manipulation methods use Excel row numbering starting with 1 instead of zero-based numbering which takes place in some methods in earlier versions, related issue #349.

    Notable Features

    • New function DuplicateRowTo() has been added for duplicate row to specified row position
    • The function SetPageLayout() now support to set page orientation, related issue #318
    • The function SetPageLayout() now support to set page size

    Bug Fixes

    • Fix the issue that creates a blank fill if no fill is specified in the style format
    • Fix the issue that data validation list in the excel sheet disappears formula characters greater than 255, related issue #339
    • Fix the issue corrupted spreadsheet file after deleting formula of the cell, related issue #346
    • Fix the issue that GetComment() returns incorrect mapping between worksheets and comments in some case, related issue #345
    • Fix the issue #346, resolve the issue corrupted spreadsheet file after deleting formula of cell
    • Fix the issue #377, avoid empty column in GetRows result

    Performance

    • Performance optimization, faster for adding comments, related issue #347, faster add images, charts, and shapes, related issue #274
    • Adding the same image should create a drawing referencing the already stored copy of the image, related issue #359
    Excelize v1.4.1 VS v2.0.0

    Miscellaneous

    • Typo fixed and godoc updated
    • Tests made stronger again, go1.12 added to tests matrix
    Source code(tar.gz)
    Source code(zip)
  • v1.4.1(Jan 3, 2019)

    We are pleased to announce the release of version 1.4.1. Featured are a handful of new areas of functionality and numerous bug fixes.

    A summary of changes is available in the Release Notes. A full list of changes is available in the change log.

    Release Notes

    The most notable changes in this release are:

    Notable Features

    • New function WriteTo() has been added, it implements io.WriterTo to write the file
    • New function SearchSheet() has been added to get coordinates by given worksheet name, cell value, and regular expression. Relate issue #277
    • New functions ProtectSheet() and UnprotectSheet() has been added to prevent other users from accidentally or deliberately changing, moving, or deleting data in a worksheet, relate issue #273
    • New functions GetMergeCells() has been added, support to get all merged cells from a worksheet currently
    • Add support to flip outline summaries, relate issue #304
    • Support go module
    • Support set and get TopLeftCell properties of sheet view options, relate issue #310
    • The function AddChart() now support to create 2D / 3D area, stacked area, 100% stacked area charts, relate issue #311

    Bug Fixes

    • Fix the issue caused by missing tradition to strict conversion for sharedStringsReader(), resolve issue #276
    • Fix unknown option in chart format JSON struct tag
    • Fix nil pointer dereference when getting cell formula in some case, resolve issue #290
    • Make the function GetRows() return value avoid empty rows in the tail of the worksheet, resolve issue #195
    • Fix GetSheetMap() failed in some case, resolve issue #297
    • Fix delete worksheet index error in some case, resolve issue #308

    Miscellaneous

    • Tests refactoring, resolve issue #322
    • Add a new logo for excelize, numerous documentation updates
    Source code(tar.gz)
    Source code(zip)
  • v1.4.0(Sep 27, 2018)

    We are pleased to announce the release of 1.4.0.

    Release Notes

    The most notable changes in this release are:

    Breaking Change

    • Add error return value for functions: AddChart(), AddComment(), AddPicture(), AddShape(), AddTable() and SetConditionalFormat()

    Notable Features

    Bug Fixes

    • Improved commenting formatting, fix expands all comment boxes stacked all in one place
    • Fix create worksheet by NewSheet() cause file issue, related issue #249

    Performance

    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(May 13, 2018)

    We are pleased to announce the release of 1.3.0.

    Release Notes

    The most notable changes in this release are:

    Breaking Change

    • Make row index consistent in function SetRowHeight() and GetRowHeight(), fix issue #205

    Notable Features

    • New function SetSheetRow() has been added for support write the whole line at once, relate issue #96 and #194
    • New functions GetColOutlineLevel(), GetRowOutlineLevel(), SetColOutlineLevel() and SetRowOutlineLevel() has been added for suppport creat group
    • Add iterator method for Rows, new functions Columns(), Next() and Error() has been added
    • Function SetCellValue() now supports bool and time.Duration type value
    • Function AddTable() now supports set name of table, relate issue #216
    • Function AddPicture() now supports set the positioning of a picture, relate issue #214
    • Function GetCellValue() now supports read inlineStr type cell value, relate issue #208 and pull request #209
    • Function AddChart() now supports set custom chart size
    • Add 3D, 3D 100%, clustered, stacked and 100% stacked bar and column series charts supported, relate issue #160 and #190
    • Add a hyperlink to image support for the function AddPicture(), relate issue #185
    • Add protection properties associated with the cell support, relate issue #191
    • Add categories or values on reverse order (orientation of the chart) support, and set auto or fixed maximum, minimum of the axis, relate issue #202

    Bug Fixes

    • Fix DeleteSheet() make broken file caused by activeTab tag calculation wrong, relate issue #165
    • Fix read columns count wrong in specific worksheet data, relate issue #175
    • Handle special shared string table file name xl/SharedStrings.xml to make library compatibility with 1C software, relate issue #188
    • Fix checkCellInArea() index out of range when the merged cell reference is single coordinate, relate issue #206
    • Fix set font-family doesn't work, relate issue #222

    Performance

    • Make SetCellStyle() quicker by skipping conversions in checkCellInArea(), and skipping area checks when we are sure the cell can't be before or past the current row/col
    • Save bytes on memory instead of string, 11% memory savings, see Performance Figures
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Jun 11, 2018)

    We are pleased to announce the release of 1.2.0.

    Release Notes

    The most notable changes in this release are:

    • Performance optimization
    • Improvement Golang 1.9 compatibility
    • Stacked bar chart supported
    • 24-hour time format supported
    • API changed, use worksheet name instead of "sheet" + index
    • Rename import path to github.com/360EntSecGroup-Skylar/excelize
    • Add new functions SetSheetViewOptions and GetSheetViewOptions
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Jun 11, 2018)

    We are pleased to announce the release of v1.1.0.

    Release Notes

    The most notable changes in this release are:

    • Feature: Conditional format support
    • Count and trim sheet name in UTF-8
    • Bugfix: deep copy issue with function CopySheet()
    Source code(tar.gz)
    Source code(zip)
Owner
360 Enterprise Security Group, Endpoint Security, inc.
360企业安全集团终端安全子公司
360 Enterprise Security Group, Endpoint Security, inc.
A Go io/fs filesystem implementation for reading files in a Github gists.

GistFS GistFS is an io/fs implementation that enables to read files stored in a given Gist. Requirements This module depends on io/fs which is only av

Jean Hadrien Chabran 126 Oct 14, 2022
Atomic: a go package for atomic file writing

atomic import "github.com/natefinch/atomic" atomic is a go package for atomic file writing By default, writing to a file in go (and generally any lan

null 0 Nov 10, 2021
app-services-go-linter plugin analyze source tree of Go files and validates the availability of i18n strings in *.toml files

app-services-go-linter app-services-go-linter plugin analyze source tree of Go files and validates the availability of i18n strings in *.toml files. A

Red Hat Developer 2 Nov 29, 2021
Split text files into gzip files with x lines

hakgzsplit split lines of text into multiple gzip files

Luke Stephens (hakluke) 6 Jun 21, 2022
Easily create Go files from stub files

go-stubs Easily create .go files from stub files in your projects. Usage go get github.com/nwby/go-stubs Create a stub file: package stubs type {{.Mo

Sam Newby 4 Jan 27, 2022
Golang PDF library for creating and processing PDF files (pure go)

UniPDF - PDF for Go UniDoc UniPDF is a PDF library for Go (golang) with capabilities for creating and reading, processing PDF files. The library is wr

UniDoc 1.8k Dec 28, 2022
Vaala archive is a tar archive tool & library optimized for lots of small files.

?? Vaar ?? Vaala archive is a tar archive tool & library optimized for lots of small files. Written in Golang, vaar performs operations in parallel &

Qing Moy 14 Sep 12, 2022
Golang wrapper for Exiftool : extract as much metadata as possible (EXIF, ...) from files (pictures, pdf, office documents, ...)

go-exiftool go-exiftool is a golang library that wraps ExifTool. ExifTool's purpose is to extract as much metadata as possible (EXIF, IPTC, XMP, GPS,

null 154 Dec 28, 2022
Load GTFS files in golang

go-gtfs Load GTFS files in Go. The project is in maintenance mode. It is kept compatible with changes in the Go ecosystem but no new features will be

Louis 34 Dec 5, 2022
Merge some files in a path with custom extension in golang

goMerge Merge some files in a path with custom extension in golang Feature Walk in a path with a goroutine using parallelism Merge files with custom e

Javad Rajabzade 4 Apr 26, 2022
QueryCSV enables you to load CSV files and manipulate them using SQL queries then after you finish you can export the new values to a CSV file

QueryCSV enable you to load CSV files and manipulate them using SQL queries then after you finish you can export the new values to CSV file

Mohamed Shapan 100 Dec 22, 2021
🏵 Gee is tool of stdin to each files and stdout

Gee is tool of stdin to each files and stdout. It is similar to the tee command, but there are more functions for convenience. In addition, it was written as go. which provides output to stdout and files.

HAHWUL 75 Nov 17, 2022
Easily create & extract archives, and compress & decompress files of various formats

archiver Introducing Archiver 3.1 - a cross-platform, multi-format archive utility and Go library. A powerful and flexible library meets an elegant CL

Matt Holt 3.8k Jan 3, 2023
A Go filesystem package for working with files and directories

Stowage A Go filesystem package for working with files and directories, it features a simple API with support for the common files and directories ope

null 19 May 28, 2021
🌳 📂 The utility displays a tree of directories and files(symlinks in future).

dirTree The utility displays a tree of directories and files. usage: dirTree [-f] How it works with directory, where I wrote this project for example

Hutiev Alexander 2 Aug 12, 2021
Allows parsing CSV files into custom structs and implements required fields that can't be empty

Welcome to Go Custom CSV Parser ?? Allows parsing CSV files into custom structs and implements required fields that can't be empty ?? Homepage Install

Elmedin Turkeš 2 Nov 9, 2021
Utility for working with files and folders stored on Google Drive

skicka Utility for working with files and folders stored on Google Drive. Note: skicka is not an official Google product! Intro skicka makes it easy t

null 0 Nov 15, 2021
Provide an upload endpoint that stores files on pinata and returns a json response with the uploaded file pinata url

Purpose Build a template repository to get to coding as quickly as possible, by starting from a common template which follows the guidelines here Feat

Dathan Vance Pattishall 0 Dec 30, 2021