profile
viewpoint

360EntSecGroup-Skylar/excelize 6449

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

xuri/aurora 460

Cross-platform beanstalkd queue server admin console.

xuri/toml-to-go 127

Translates TOML into a Go type in your browser instantly https://xuri.me/toml-to-go

xuri/efp 42

Go Microsoft Excel™ Formula Parser

xuri/glc 21

GLC (glog cleaner) is a log cleaner for glog.

xuri/timefragment 14

:clock9: Time Fragments

xuri/excelize-doc 10

Docs reference for the excelize library. https://xuri.me/excelize

xuri/php-oop 4

PHP Objects, Patterns, and Practice

xuri/awesome-go 2

A curated list of awesome Go frameworks, libraries and software

issue openedgophers/gophers.github.io

申请加入这个组织

谢谢。

created time in 2 days

push event360EntSecGroup-Skylar/excelize

Jérôme Pogeant

commit sha e9a4007c17f0db01b52bb40ab744c25e0f9e9673

Implement columns iterator

view details

xuri

commit sha dcb772d6921ce21d0f50907bd4dcd926fde15891

Merge pull request #653 from Jerome1337/648-column-iterator Implement columns iterator

view details

xuri

commit sha 5221729bc342c5b12883ebe03898a85f755233c9

make columns iterator read cell streamingly and add max column limit on ColumnNumberToName

view details

xuri

commit sha 15fd56853fe1b63217fb963c951cf4fef7b56a08

Update docs and typo fixed

view details

xuri

commit sha 48f19f60aa3e162146a9dc4edf7b4c8cf687ec26

support the row element without r attribute in the worksheet

view details

xuri

commit sha 1cbb05d4977fc1c03fa37d704118fd9c722e487d

GetCols support the row element without r attribute in the worksheet

view details

xuri

commit sha f7bd0729c65fc82305328f7ac8fbaf329d1075c0

Resolve #32, fix missing leading/leading spaces when working with SST

view details

push time in 5 days

issue comment360EntSecGroup-Skylar/excelize

Leading space(s) are missing

Hi @huyhoang1996, thanks for your feedback. I have fixed it.

rpokupec

comment created time in 5 days

push event360EntSecGroup-Skylar/excelize

xuri

commit sha f7bd0729c65fc82305328f7ac8fbaf329d1075c0

Resolve #32, fix missing leading/leading spaces when working with SST

view details

push time in 5 days

issue closed360EntSecGroup-Skylar/excelize

Get cell value in custom date format

Hello, I'm using excel in a project with Windows, in the excel file there is a cell with a custom format following the following date pattern: 6/11/2020 17:39:36 PM.

When I search for the value of this cell using excelize, it returns a number for example 43993. I would like to know if there is any way to capture this cell value. I may be making a mistake.

go version go1.13.4 windows / amd64 github.com/360EntSecGroup-Skylar/excelize/v2 v2.2.0

closed time in 6 days

CezarGarrido

issue comment360EntSecGroup-Skylar/excelize

Get cell value in custom date format

Thanks for your issue. GetCellValue just supports get cell value with Excel's built-in formats number format currently. If it couldn't apply a number format of the cell value, it will return the raw value of the cell. Also reference #50 and #73.

CezarGarrido

comment created time in 6 days

issue comment360EntSecGroup-Skylar/excelize

SetColWidth not affect when use NewStreamWriter

func writeCell(buf *bufferedWriter, c xlsxC) { buf.WriteString(<c) if c.XMLSpace.Value != "" { fmt.Fprintf(buf, xml:%s="%s", c.XMLSpace.Name.Local, c.XMLSpace.Value) } fmt.Fprintf(buf, r="%s", c.R) if c.S != 0 { fmt.Fprintf(buf, s="%d", c.S) } if c.T != "" { fmt.Fprintf(buf, t="%s", c.T) } buf.WriteString(>) if c.V != "" { buf.WriteString(<v>) xml.EscapeText(buf, stringToBytes(c.V)) buf.WriteString(</v>) } buf.WriteString(</c>) }

stringToBytes this method will lead to panic occasionally with unknown reasons

Thanks for your feedback. Could you provide any sample code to trigger this issue?

coder4life9192

comment created time in 6 days

issue comment360EntSecGroup-Skylar/excelize

SetColWidth not affect when use NewStreamWriter

Thanks for your issue. SetColWidth is not a streaming API, so the column width setting will lose after stream writer flush data. I will add set column width support for the stream writer later.

coder4life9192

comment created time in 6 days

push eventxuri/excelize-doc

xuri

commit sha 247c1175c112b4a1eb495808665d2c839cd38e0e

Update basic example and new vendor

view details

push time in 7 days

push eventxuri/excelize-doc

xuri

commit sha d1e7e9bc4ee9894023705d964d2296ea696a6ad3

Using `fmt.Println` instead of `println`

view details

push time in 8 days

push event360EntSecGroup-Skylar/excelize

xuri

commit sha 1cbb05d4977fc1c03fa37d704118fd9c722e487d

GetCols support the row element without r attribute in the worksheet

view details

push time in 9 days

push event360EntSecGroup-Skylar/excelize

xuri

commit sha 48f19f60aa3e162146a9dc4edf7b4c8cf687ec26

support the row element without r attribute in the worksheet

view details

push time in 10 days

delete branch 360EntSecGroup-Skylar/excelize

delete branch : revert-653-648-column-iterator

delete time in 10 days

GollumEvent
GollumEvent

push eventxuri/excelize-doc

xuri

commit sha f2a69bbe2ed52cd5df14789c388dbbe93d7c325d

Add detail docs for the column iterator.

view details

push time in 10 days

issue comment360EntSecGroup-Skylar/excelize

Cell value not updating and showing 0 in Google Mail Preview and causing Div/0 in formula fields

Thanks for your feedback. Could you provide code or attachment without confidential info?

ChrisKarlin

comment created time in 11 days

issue comment360EntSecGroup-Skylar/excelize

get style details

I will consider adding support for this feature later. I'll certainly accept that patch if somebody did that.

shaunc

comment created time in 11 days

push eventxuri/excelize-doc

xuri

commit sha b3e55b07281ce03dfe18c88df034908f3adb316a

Add ko and ru version docs for new API: GetCols and column iterator

view details

push time in 11 days

push eventxuri/excelize-doc

xuri

commit sha 5ec74eb7a5ec4f67cd12fd844f7571f2bb530b2c

Add docs for new API: GetCols and column iterator

view details

push time in 14 days

issue closedkon9chunkit/GitHub-Chinese-Top-Charts

[项目推荐] Excelize: Go 语言 Excel 文档基础库

项目地址: https://github.com/360EntSecGroup-Skylar/excelize 中文文档: https://xuri.me/excelize/zh-hans

分类: Go

介绍:Excelize 是 Go 语言编写的用于操作 Office Excel 文档基础库,基于 ECMA-376,ISO/IEC 29500 国际标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM 等多种文档格式,高度兼容带有样式、图片(表)、透视表、切片器等复杂组件的文档,并提供流式读写 API,用于处理包含大规模数据的工作簿。可应用于各类报表平台、云计算、边缘计算等系统。

closed time in 14 days

xuri

issue commentkon9chunkit/GitHub-Chinese-Top-Charts

[项目推荐] Excelize: Go 语言 Excel 文档基础库

谢谢,但由于一些原因我没有权限修改项目描述,先关闭此 Issue 了。

xuri

comment created time in 14 days

push event360EntSecGroup-Skylar/excelize

xuri

commit sha 15fd56853fe1b63217fb963c951cf4fef7b56a08

Update docs and typo fixed

view details

push time in 15 days

push event360EntSecGroup-Skylar/excelize

xuri

commit sha 5221729bc342c5b12883ebe03898a85f755233c9

make columns iterator read cell streamingly and add max column limit on ColumnNumberToName

view details

push time in 15 days

Pull request review comment360EntSecGroup-Skylar/excelize

Implement columns iterator

 const ( 	EMU                    int     = 9525 ) +// Cols defines an iterator to a sheet+type Cols struct {+	err                                  error+	curCol, totalCol, stashCol, totalRow int+	sheet                                string+	cols                                 []xlsxCols+	f                                    *File+	decoder                              *xml.Decoder+}++// GetCols return all the columns in a sheet by given worksheet name (case sensitive). For example:+//+//    cols, err := f.Cols("Sheet1")+//    if err != nil {+//        fmt.Println(err)+//        return+//    }+//    for cols.Next() {+//        col, err := cols.Rows()+//        if err != nil {+//            fmt.Println(err)+//        }+//        for _, rowCell := range col {+//            fmt.Print(rowCell, "\t")+//        }+//        fmt.Println()+//    }+//+func (f *File) GetCols(sheet string) ([][]string, error) {+	cols, err := f.Cols(sheet)+	if err != nil {+		return nil, err+	}++	results := make([][]string, 0, 64)++	for cols.Next() {+		if cols.Error() != nil {+			break+		}++		col, err := cols.Rows()+		if err != nil {+			break+		}++		results = append(results, col)+	}++	return results, nil+}++// Next will return true if the next col element is found.+func (cols *Cols) Next() bool {+	cols.curCol++++	return cols.curCol <= cols.totalCol+}++// Error will return an error when the next col element is found.+func (cols *Cols) Error() error {+	return cols.err+}++// Rows return the current column's row values+func (cols *Cols) Rows() ([]string, error) {+	var (+		err  error+		rows []string+	)++	if cols.stashCol >= cols.curCol {+		return rows, err+	}++	for i := 1; i <= cols.totalRow; i++ {+		colName, _ := ColumnNumberToName(cols.curCol)+		val, _ := cols.f.GetCellValue(cols.sheet, fmt.Sprintf("%s%d", colName, i))

GetCellValue is not streaming API, we need to implement stream reader instead of that.

Jerome1337

comment created time in 16 days

create barnch360EntSecGroup-Skylar/excelize

branch : revert-653-648-column-iterator

created branch time in 16 days

pull request comment360EntSecGroup-Skylar/excelize

Implement columns iterator

LGTM, thanks @Jerome1337!

Jerome1337

comment created time in 16 days

push event360EntSecGroup-Skylar/excelize

Jérôme Pogeant

commit sha e9a4007c17f0db01b52bb40ab744c25e0f9e9673

Implement columns iterator

view details

xuri

commit sha dcb772d6921ce21d0f50907bd4dcd926fde15891

Merge pull request #653 from Jerome1337/648-column-iterator Implement columns iterator

view details

push time in 16 days

PR merged 360EntSecGroup-Skylar/excelize

Implement columns iterator

PR Details

Implement worksheet columns iterator

Description

<!--- Describe your changes in detail --> Create an iterator function that will loop over every columns Create a Next() and Error() functions like the rows iterator

Related Issue

Fixes #648

Motivation and Context

In some cases it is very helpful to iterate over columns instead rows For example reading or writing vertical table

How Has This Been Tested

<!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. -->

Tested using Go tests Manually tested inside a personal project depending on Excelize

Every tests has been run on Ubuntu 18.04 and Go 1.13.4

Types of changes

<!--- What types of changes does your code introduce? Put an x in all the boxes that apply: -->

  • [ ] 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

<!--- Go over all the following points, and put an x in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [x] 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.
+291 -0

1 comment

2 changed files

Jerome1337

pr closed time in 16 days

issue closed360EntSecGroup-Skylar/excelize

Provide column iterator

Description

It would be great to have a column iterator like the row one to loop over all file rows. It would have the same usage as https://xuri.me/excelize/en/sheet.html#Rows

<!-- Briefly describe the problem you are having in a few paragraphs. -->

Steps to reproduce the issue:

  1. Load a XLSX file
  2. Try to iterate over columns

Describe the results you expected:

I can use something like that:

func (f *File) Columns(sheet string) (*Columns, error)

Then use the column iterator helper functions

// Column iterator - Rows
func (columns *Columns) Rows() ([]string, error)

// Column iterator - Traversing
func (columns *Columns) Next() bool

// Column iterator - Error handling
func (columns *Columns) Error() error

Excelize version or commit ID:

v2.2.0

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

  • Ubuntu 19.04
  • Go 1.14
  • Microsoft Excel™ Version 2005 (build 12827.20268 Office) on Windows 10

closed time in 16 days

Jerome1337

issue comment360EntSecGroup-Skylar/excelize

Cell value not updating and showing 0 in Google Mail Preview and causing Div/0 in formula fields

Thanks for your issue. Google Docs preview doesn't calculate formula results when you preview the spreadsheet in Gmail. SetCellFormula API doesn't calculate and storage results for the formula, to resolve this issue, we need to implement a formula engine, I'm working on it by adding new CalcCellValue API and in progress recently, also reference #65.

ChrisKarlin

comment created time in 16 days

GollumEvent
GollumEvent
GollumEvent
GollumEvent
GollumEvent
GollumEvent

issue comment360EntSecGroup-Skylar/excelize

StreamWriter Formula

I have added this feature request to the Roadmap.

bconn98

comment created time in 21 days

GollumEvent

issue comment360EntSecGroup-Skylar/excelize

fatal error: out of memory @ streamWriter.Flush()

Thanks for your feedback. I'll take an evaluation later.

robinsoon

comment created time in 24 days

push eventxuri/xgen

xuri

commit sha 83cc4f35f308817343cb474da60c6af9e2455ed9

Enumeration support for TypeScript

view details

push time in 25 days

issue comment360EntSecGroup-Skylar/excelize

cant open xlsx file with wps

Thanks for your feedback. Please follow by issue template to provide code/attachments and steps to reproduce the issue.

huanlingkeji

comment created time in 25 days

push eventxuri/xgen

xuri

commit sha b2ebd6be0566bf1669f9657401d5c96f71144566

Fix invalid TypeScript datatype

view details

push time in a month

GollumEvent

issue comment360EntSecGroup-Skylar/excelize

How to read excel with GBK encoding ?

You can set custom codepage transcoder by CharsetTranscoder to open a spreadsheet from non-UTF-8 encoding.

linxinfu

comment created time in a month

push event360EntSecGroup-Skylar/excelize

马彦军

commit sha aa7eadbffe6ae2f9f86201bbaaa4c1d1e8829cae

fix go lock

view details

xuri

commit sha dfea8f96edc326717822ec9c4b92f462d0fe1255

- New API: SetSheetFormatPr and GetSheetFormatPr - typo fix, resolve #635

view details

xuri

commit sha 9baa1bbc9865bee1b3c8981ab98eb8c9049c40e4

Fix #637, improve the compatibility of the auto filter with Office 2007 - 2013

view details

yuemanxilou

commit sha c815e4b84b9b777c30d127f384b38105afa2640d

avoid duplicate filter database in workbook defined name

view details

xuri

commit sha 9b7d8463d39ad5fcaae24e5a3b7da296c5e29d17

Merge pull request #638 from yuemanxilou/master avoid duplicate filter database in workbook defined name

view details

xuri

commit sha 98221a332ff9c37c9b20c44e9efdbe4c22a5cf5c

Merge pull request #410

view details

xuri

commit sha 2efc7107ff30dc7f1e1a798082616ee488f99489

- transform the range to the matrix on the first arg of the formula - typo fix - reset cell with and height when insert picture into merged cell with autofit

view details

xuri

commit sha ec14de32f0c06f7a26b6b79578f666c0cc50b72c

Merge branch 'master' into fix/cell_lock

view details

xuri

commit sha 0dd616b18fef393ea5b632ba25ca365575f5f61b

Merge pull request #517 from hengmyj/fix/cell_lock make set cell value is concurrency safe

view details

sachin-puranik

commit sha 82bb1153d7b7ff1c50725bf34bd3cbc75b228137

Improved error handling and stoped the crash due to fatel error (#593) close #624

view details

xuri

commit sha 7f78464f7f6ecd87c5f5c53d7c00320fd53c4a03

add test for ReadZipReader, close #642

view details

xuri

commit sha a546427fd9324af8320e3f7062ddba8d2343a3c3

Resolve #643, avoid creating duplicate style

view details

xuri

commit sha 1aeb8182357ae4f1415fccb586c85f26483f0d99

avoid creating duplicate number format

view details

xuri

commit sha 5c99300ee44de15e92bd8c5a92f2183c804d1379

Fix #622, storage string to SST (shared string table)

view details

xuri

commit sha c168233e70db8f220bd07d9d6d277ae9e2a4a73f

speedup get cell value from shared string table

view details

xuri

commit sha 2ae631376b95ff0a59ea18c2c0befcd50135b020

add limits for total columns, row and filename length

view details

xuri

commit sha fa2571a17e869d5793d14dd67d8e2a6d15e80daf

fn: SUMIF

view details

xuri

commit sha 22df34c4933bb28f6827b011cb6d9d3fd9f0e8d2

fn: ISBLANK, ISERR, ISERROR, ISEVEN, ISNA, ISNONTEXT, ISODD, NA

view details

xuri

commit sha b62950a39ef2063ec19c221a32d37bd01f197472

fn: MEDIAN, ISNUMBER

view details

xuri

commit sha b6dd7648a142901655cc4f76cb7d3a6e73338c8f

fn: COUNTA

view details

push time in a month

pull request comment360EntSecGroup-Skylar/excelize

escape html tag

LGTM, thanks @heiy.

heiy

comment created time in a month

push event360EntSecGroup-Skylar/excelize

heiy

commit sha eb150c0c22749a11618a3e77ffc9ad0d58f11056

escape html tag

view details

xuri

commit sha 8ce48b859a3803647a247a53b3c9fd49192fd4a7

Merge pull request #647 from heiy/master escape html tag

view details

push time in a month

PR merged 360EntSecGroup-Skylar/excelize

escape html tag

PR Details

<!--- Provide a general summary of your changes in the Title above -->

support html tag

<!--- Describe your changes in detail -->

use html.EscapeString to transform the html tag

<!--- This project only accepts pull requests related to open issues --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please link to the issue here: -->

Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

if excel have html tag , it well be empty

<!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. -->

Types of changes

<!--- What types of changes does your code introduce? Put an x in all the boxes that apply: -->

  • [ ] 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

<!--- Go over all the following points, and put an x in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [x] 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.
+2 -1

1 comment

1 changed file

heiy

pr closed time in a month

push eventxuri/efp

xuri

commit sha ba689101faaf67e0ce42ca6604e1e9b66a7fdc02

Fix panic caused by pop empty token stack

view details

push time in a month

push event360EntSecGroup-Skylar/excelize

xuri

commit sha b6dd7648a142901655cc4f76cb7d3a6e73338c8f

fn: COUNTA

view details

push time in a month

issue comment360EntSecGroup-Skylar/excelize

How to read excel in cursor mode, that is, reduce memory reading in batches?

You can get all the data in the worksheet as streaming by Rows, read the data row by row using Next, also ref: #515.

yizhidaozuihou

comment created time in a month

push event360EntSecGroup-Skylar/excelize

xuri

commit sha b62950a39ef2063ec19c221a32d37bd01f197472

fn: MEDIAN, ISNUMBER

view details

push time in a month

push event360EntSecGroup-Skylar/excelize

xuri

commit sha 22df34c4933bb28f6827b011cb6d9d3fd9f0e8d2

fn: ISBLANK, ISERR, ISERROR, ISEVEN, ISNA, ISNONTEXT, ISODD, NA

view details

push time in a month

push event360EntSecGroup-Skylar/excelize

xuri

commit sha fa2571a17e869d5793d14dd67d8e2a6d15e80daf

fn: SUMIF

view details

push time in a month

push event360EntSecGroup-Skylar/excelize

xuri

commit sha 2ae631376b95ff0a59ea18c2c0befcd50135b020

add limits for total columns, row and filename length

view details

push time in a month

issue comment360EntSecGroup-Skylar/excelize

about text style

Which version of Excelize are you using, could you provide non-confidential information attachment?

huanlingkeji

comment created time in a month

GollumEvent

push eventxuri/excelize-doc

xuri

commit sha 73709a89f33a3a181debf7104dd391088cc74dee

Update benchmark report

view details

push time in a month

fork xuri/GitHub-Chinese-Top-Charts

:cn: GitHub中文排行榜,帮助你发现高分优秀中文项目、更高效地吸收国人的优秀经验成果;榜单每周更新一次,敬请关注!(中国加油!世界加油!)

fork in a month

issue openedkon9chunkit/GitHub-Chinese-Top-Charts

[项目推荐] Excelize: Go 语言 Excel 文档基础库

项目地址: https://github.com/360EntSecGroup-Skylar/excelize 中文文档: https://xuri.me/excelize/zh-hans

分类: Go

介绍:Excelize 是 Go 语言编写的用于操作 Office Excel 文档基础库,基于 ECMA-376,ISO/IEC 29500 国际标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM 等多种文档格式,高度兼容带有样式、图片(表)、透视表、切片器等复杂组件的文档,并提供流式读写 API,用于处理包含大规模数据的工作簿。可应用于各类报表平台、云计算、边缘计算等系统。

created time in a month

push event360EntSecGroup-Skylar/excelize

xuri

commit sha c168233e70db8f220bd07d9d6d277ae9e2a4a73f

speedup get cell value from shared string table

view details

push time in a month

issue comment360EntSecGroup-Skylar/excelize

Cell type of strings always set to "string formula"

Thanks for your issue. I had fixed it by making save the string in the shared string table.

gmolau

comment created time in a month

push event360EntSecGroup-Skylar/excelize

xuri

commit sha 5c99300ee44de15e92bd8c5a92f2183c804d1379

Fix #622, storage string to SST (shared string table)

view details

push time in a month

issue closed360EntSecGroup-Skylar/excelize

Cell type of strings always set to "string formula"

<!-- If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.

Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST -->

It seems that this library always sets the type of string cells to str, which actually represents formulas that return strings, the type for raw strings seems to be s. This can cause unexpected issues when parsing the files with another library, I think it would at the very least be good to document this here.

<!-- Briefly describe the problem you are having in a few paragraphs. -->

Steps to reproduce the issue:

  1. Set a plain string cell
  2. Inspect the cell type here, it will be str, not s
  3. As this library has no way to read the cell type one has to parse it with another one, e.g. tealeg/xlsx, but this then reports the cell type as StringFormula, not the expected String.

Output of go version:

go version go1.13 darwin/amd64

Excelize version or commit ID:

github.com/360EntSecGroup-Skylar/excelize/v2 v2.1.0

closed time in a month

gmolau

issue comment360EntSecGroup-Skylar/excelize

Rows.Next(): unusual behaviour

Thanks for your feedback. Each call of rows.Columns() will read a row, Next just used to check if the end of the streaming.

andvary

comment created time in a month

issue closedxuri/efp

Is anyone using another package to evaluate these AST's?

Given the below example:

SUM <Function> <Start>
    A3 <Operand> <Range>
    + <OperatorInfix> <Math>
    B9 <Operand> <Range>
    * <OperatorInfix> <Math>
    2 <Operand> <Number>
 <Function> <Stop>
/ <OperatorInfix> <Math>
2 <Operand> <Number>

How do you evaluate the expression? And if you don't evaluate it, what do you use the AST for?

closed time in a month

ccorliss

push event360EntSecGroup-Skylar/excelize

xuri

commit sha 1aeb8182357ae4f1415fccb586c85f26483f0d99

avoid creating duplicate number format

view details

push time in a month

issue comment360EntSecGroup-Skylar/excelize

Generating big tables with time cells results with corrupted file

Thanks for your issue. I have fixed it. Please try to upgrade the library with the master branch code.

ludmanp

comment created time in a month

push event360EntSecGroup-Skylar/excelize

xuri

commit sha a546427fd9324af8320e3f7062ddba8d2343a3c3

Resolve #643, avoid creating duplicate style

view details

push time in a month

issue closed360EntSecGroup-Skylar/excelize

Generating big tables with time cells results with corrupted file

Description

Generating big table with time columns output file is corrupted.

Steps to reproduce the issue: here is example script `package main

import ( "flag" "fmt" "github.com/360EntSecGroup-Skylar/excelize" "math/rand" "reflect" "strconv" "time" )

type NullTime struct { Time time.Time Valid bool // Valid is true if Time is not NULL }

func main() { r := rand.New(rand.NewSource(99))

excel := excelize.NewFile()

sheetName := "Test sheet"
sheetIndex := excel.GetActiveSheetIndex()
excel.SetSheetName(excel.GetSheetName(sheetIndex), sheetName)

dateStyle, _ := excel.NewStyle(`{"custom_number_format": "yyyy-mm-dd"}`)
floatStyle, _ := excel.NewStyle(`{"number_format": 2}`)

rowsCount := flag.Int("rows", 100, "Number of rows")
flag.Parse()
for row := 1; row <= *rowsCount; row++ {
	for col := 1; col <= 10; col++ {
		val := randate()
		t := reflect.ValueOf(val)
		_ = excel.SetCellValue(sheetName, intToCharIndex(col)+strconv.Itoa(row), t.Interface())
		_ = excel.SetCellStyle(sheetName, intToCharIndex(col)+strconv.Itoa(row), intToCharIndex(col)+strconv.Itoa(row), dateStyle)
	}
	for col := 11; col <= 101; col++ {
		_ = excel.SetCellValue(sheetName, intToCharIndex(col)+strconv.Itoa(row), r.Float64())
		_ = excel.SetCellStyle(sheetName, intToCharIndex(col)+strconv.Itoa(row), intToCharIndex(col)+strconv.Itoa(row), floatStyle)
	}
}
if err := excel.SaveAs("Test.xlsx"); err != nil {
	fmt.Println(err)
}

}

func intToCharIndex(i int) string { col, _ := excelize.ColumnNumberToName(i+1) return col }

func randate() time.Time { min := time.Date(2010, 1, 0, 0, 0, 0, 0, time.UTC).Unix() max := time.Date(2020, 1, 0, 0, 0, 0, 0, time.UTC).Unix() delta := max - min

sec := rand.Int63n(delta) + min
return time.Unix(sec, 0).UTC()

}

`

making some 100 or 1000 rows output file is ok, making 10k rows file is corrupted.

Describe the results you received:

Describe the results you expected:

Output of go version:

go version go1.14.2 darwin/amd64

Excelize version or commit ID:

v2.2.0

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

macOS Catalina, MS Excel for Mac 16.37

closed time in a month

ludmanp

push event360EntSecGroup-Skylar/excelize

xuri

commit sha 7f78464f7f6ecd87c5f5c53d7c00320fd53c4a03

add test for ReadZipReader, close #642

view details

push time in a month

PR closed 360EntSecGroup-Skylar/excelize

lib.readFile() size/XS

不使用log.Fatal() 只打印错误信息 让用户来处理

PR Details

<!--- Provide a general summary of your changes in the Title above -->

Description

<!--- Describe your changes in detail -->

Related Issue

<!--- This project only accepts pull requests related to open issues --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please link to the issue here: -->

Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

How Has This Been Tested

<!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. -->

Types of changes

<!--- What types of changes does your code introduce? Put an x in all the boxes that apply: -->

  • [ ] Docs change / refactoring / dependency upgrade
  • [ ] 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

<!--- Go over all the following points, and put an x in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

  • [ ] 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.
+8 -2

4 comments

1 changed file

xiaoxfan

pr closed time in a month

push event360EntSecGroup-Skylar/excelize

sachin-puranik

commit sha 82bb1153d7b7ff1c50725bf34bd3cbc75b228137

Improved error handling and stoped the crash due to fatel error (#593) close #624

view details

push time in a month

PR merged 360EntSecGroup-Skylar/excelize

Improved error handling and stoped the crash due to fatel error size/XS

PR Details

<!--- Provide a general summary of your changes in the Title above -->

While using library my application was crashing while opening a corrupted excel file. Now with changed error handling the error is passed upto upper layers.

<!--- Describe your changes in detail -->

Related Issue

<!--- This project only accepts pull requests related to open issues --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please link to the issue here: -->

Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

How Has This Been Tested

<!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. -->

Types of changes

<!--- What types of changes does your code introduce? Put an x in all the boxes that apply: -->

  • [ ] Docs change / refactoring / dependency upgrade
  • [ ] 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

<!--- Go over all the following points, and put an x in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

  • [ ] 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.
+8 -4

2 comments

1 changed file

sachin-puranik

pr closed time in a month

pull request comment360EntSecGroup-Skylar/excelize

lib.readFile()

Thanks for your PR, this fix similar to #593, I purpose that add an error return for the readFile instead of using log.Println, could you gave a case to cause log.Fatal via call ReadZipReader?

xiaoxfan

comment created time in a month

pull request comment360EntSecGroup-Skylar/excelize

fix go lock

LGTM, thanks @hengmyj.

hengmyj

comment created time in a month

push event360EntSecGroup-Skylar/excelize

马彦军

commit sha aa7eadbffe6ae2f9f86201bbaaa4c1d1e8829cae

fix go lock

view details

xuri

commit sha ec14de32f0c06f7a26b6b79578f666c0cc50b72c

Merge branch 'master' into fix/cell_lock

view details

xuri

commit sha 0dd616b18fef393ea5b632ba25ca365575f5f61b

Merge pull request #517 from hengmyj/fix/cell_lock make set cell value is concurrency safe

view details

push time in a month

PR merged 360EntSecGroup-Skylar/excelize

fix go lock size/S

PR Details

<!--- Provide a general summary of your changes in the Title above -->

Description

<!--- Describe your changes in detail --> 主要解决多多线程导出时的错误,添加的锁解决问题

Related Issue

<!--- This project only accepts pull requests related to open issues --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please link to the issue here: -->

Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

How Has This Been Tested

<!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. -->

Types of changes

<!--- What types of changes does your code introduce? Put an x in all the boxes that apply: -->

  • [ ] Docs change / refactoring / dependency upgrade
  • [ ] 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

<!--- Go over all the following points, and put an x in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

  • [ ] 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.
+13 -0

1 comment

1 changed file

hengmyj

pr closed time in a month

push eventhengmyj/excelize

xuri

commit sha 01a418bda8502890e89ab20a2b41220372877bae

Resolve #392, compatible with strict relations name space inspection

view details

xuri

commit sha b1f632d4084130628f10906ff6a7bb55022e4c08

Resolve #393, upgrade Go module to v2

view details

xuri

commit sha 63e97ffc9aae35780cdbd69ad966fb101fc5217f

Remove Go 1.8 test in TravisCI

view details

xuri

commit sha 72701e89c7145f9d08a79c93040e232b2875c855

Fix structs fields definition errors and keep double quotes in data validation formula

view details

xuri

commit sha 69b38ddcd60f7cf4c158c706ddbbeb89a8ff2108

Resolve #394, init set header and footer support

view details

xuri

commit sha 25763ba3e1af39bf2fd00bfa6aabcb054ca78327

fixed #373, comments duplicate caused by inner counting errors

view details

xuri

commit sha 7e77e14814658486267e3f237f484fa8e63a0cd4

Resolve #397, support set style by columns

view details

xuri

commit sha f91f548614a7182ce66d55d10ed311e9b7e08a2a

Resolve #404, get sheet map by target rels.

view details

Harris

commit sha b1c9884f6d186bd1bfb4fc1d34061856345b8530

Add the ability to change the default font Closes #390

view details

xuri

commit sha 623375780586cbd323dc899e17d7235ac610505f

Merge pull request #391 from mlh758/390-change-default-font Add the ability to change the default font

view details

xuri

commit sha d038ca2e9c755abb6458606a90129559f14dc33b

Fix #413, make pivot cache ID not omit empty

view details

xuri

commit sha db99373b25a3f5c986d8f7d26ec983853574a17d

Resolve #415, init set and get doc properties support

view details

xuri

commit sha cff16fa8118291fd885f3f3f75fa07e28bba5eec

- Supplemental worksheet struct fields and field order adjustment - Testing case for set and get doc properties - Update charts struct XML tags

view details

xuri

commit sha 3997dee1f58c81444733e1756da6138d4ce445f1

Fix #411, change font size to float type

view details

xuri

commit sha 421f945f51f254054991127758db0520cf0f5456

Fixed #418, #420, #421, init adjust calculation chain support Update testing case

view details

xuri

commit sha 46a3632ee0f441c8990a7205445dfdb00823a6ad

Fix #422, avoid accent theme color index overflow

view details

xuri

commit sha 821632cf89422b9955160a3af7f28f05a12f70f8

Fix #424, refactor merged cells adjuster

view details

xuri

commit sha e124f6000a2ea731b96a07d6bf2901781e272d90

Fix #425, handle empty font style format

view details

xuri

commit sha dc0869fde3a717009eb4aeff6a26387f0495b655

support to create cone, pyramid and cylinder series chart for column and bar types

view details

xuri

commit sha 5cf1c05ed48ad92b6c58d3dfe7d3598526b77b01

Add surface 3D, wireframe Surface 3D, contour, and wireframe contour chart support

view details

push time in a month

issue comment360EntSecGroup-Skylar/excelize

function to get the next column

We can convert between column name and index with ColumnNameToNumber and ColumnNumberToName.

so-jelly

comment created time in a month

push event360EntSecGroup-Skylar/excelize

xuri

commit sha 2efc7107ff30dc7f1e1a798082616ee488f99489

- transform the range to the matrix on the first arg of the formula - typo fix - reset cell with and height when insert picture into merged cell with autofit

view details

push time in a month

GollumEvent

push eventxuri/excelize-doc

xuri

commit sha b1c199627be463f670761c85cec908985e752a76

Update readme

view details

push time in 2 months

push eventxuri/excelize-doc

xuri

commit sha faeeaea960f4767ed1b438400d8d7bde9ee0aa98

Docs for OpenReader

view details

push time in 2 months

issue comment360EntSecGroup-Skylar/excelize

Failed to copy a sheet between two files.

This library doesn't support operation cross spreadsheets currently, this issue similar to also #41, #532, #574, and #629.

wenj1104

comment created time in 2 months

issue commentxuri/xgen

Wrong Element genetarion

Hi @luizvnasc, I have fixed it, please try to upgrade the command line tools with the master branch code.

luizvnasc

comment created time in 2 months

push eventxuri/xgen

xuri

commit sha 9d86302331327c149296345f849f594427dc0f4f

Fix #3, support include schema

view details

push time in 2 months

issue closedxuri/xgen

Wrong Element genetarion

I'm trying to generate a struct for the bellow element but the result wasn't the expected. Element

<xs:element name="infNFe" maxOccurs="unbounded">
<!-- Other elements-->
<xs:element name="PIN" minOccurs="0">
	<xs:annotation>
		<xs:documentation>PIN SUFRAMA</xs:documentation>
		<xs:documentation>PIN atribuído pela SUFRAMA para a operação.</xs:documentation>
	</xs:annotation>
	<xs:simpleType>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:minLength value="2"/>
			<xs:maxLength value="9"/>
			<xs:pattern value="[1-9]{1}[0-9]{1,8}"/>
		</xs:restriction>
	</xs:simpleType>
</xs:element>
</xs:element>

Generated code :

// InfNFe ...
type InfNFe struct {
	XMLName	xml.Name	`xml:"infNFe"`
	Chave	string	`xml:"chave"`
	PIN	*PIN	`xml:"PIN"`
	DPrev	string	`xml:"dPrev"`
	InfUnidCarga	[]*TUnidCarga	`xml:"infUnidCarga"`
	InfUnidTransp	[]*TUnidadeTransp	`xml:"infUnidTransp"`
}

Expected result:

// InfNFe ...
type InfNFe struct {
	XMLName	xml.Name	`xml:"infNFe"`
	Chave	string	`xml:"chave"`
	PIN	*string	`xml:"PIN"`
	DPrev	string	`xml:"dPrev"`
	InfUnidCarga	[]*TUnidCarga	`xml:"infUnidCarga"`
	InfUnidTransp	[]*TUnidadeTransp	`xml:"infUnidTransp"`
}

Output of go version:

go version go1.14.2 windows/amd64

Environment details (OS, physical, etc.):

windows 10 64bits

closed time in 2 months

luizvnasc

issue closed360EntSecGroup-Skylar/excelize

how can I copy the cell style from one file to another file

how can I copy the cell style from one file to another file

closed time in 2 months

huanlingkeji

issue comment360EntSecGroup-Skylar/excelize

how can I copy the cell style from one file to another file

This issue similar to #41, #532, and #574. I close this and merge it into issue #41 is still discussing this feature.

huanlingkeji

comment created time in 2 months

issue closed360EntSecGroup-Skylar/excelize

Add a function to resize the insert image to fit the cell

Description It is a proposal of the function to implement. I want to add the function to resize and insert an image fit to the cell. Resize to the size of a single cell or merged cell without changing the aspect ratio of the original image.

ex.) xlsx.AddPicture("Sheet1", "A2", "./image1.jpg",{"autofit": true}) I would like to implement such a function. What do you think?

closed time in 2 months

yoshhiide

issue comment360EntSecGroup-Skylar/excelize

Add a function to resize the insert image to fit the cell

I resolve conflicts and perform a manual merge.

yoshhiide

comment created time in 2 months

pull request comment360EntSecGroup-Skylar/excelize

resize the insert image to fit the cell

Sorry for my late reply. I have added autofit support for AddPicture API. Thanks for your PR, @yoshhiide. I resolve conflicts and perform a manual merge.

yoshhiide

comment created time in 2 months

PR closed 360EntSecGroup-Skylar/excelize

resize the insert image to fit the cell size/L

PR Details

resize the insert image to fit the cell.

Description

Added "autofit" option to "AddPicture". Resize the image to the size of a single cell or merged cell.

example)

xlsx.AddPicture("Sheet1", "A30", "./image1.jpg", {"autofit": true})
xlsx.AddPicture("Sheet1", "B30", "./image1.jpg", {"autofit": true, "x_offset": 10, "y_offset": 10})

result) TestAddPicture_xlsx "B30: C33" is a merged cell

Related Issue

#384

Motivation and Context

I want to reduce manual editing by automatic image resizing.

How Has This Been Tested

I added a test code to picture_test.go and verified it.

Types of changes

<!--- What types of changes does your code introduce? Put an x in all the boxes that apply: -->

  • [x] 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

<!--- Go over all the following points, and put an x in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [x] 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.
+223 -4

3 comments

6 changed files

yoshhiide

pr closed time in 2 months

push event360EntSecGroup-Skylar/excelize

xuri

commit sha 98221a332ff9c37c9b20c44e9efdbe4c22a5cf5c

Merge pull request #410

view details

push time in 2 months

push eventxuri/excelize-doc

xuri

commit sha 18578555ca77c2ddb6b07136b339af6c4347c905

Docs for the new function SetSheetFormatPr and GetSheetFormatPr

view details

push time in 2 months

pull request comment360EntSecGroup-Skylar/excelize

avoid duplicate filter database in workbook defined name

LGTM, thanks @yuemanxilou.

yuemanxilou

comment created time in 2 months

push event360EntSecGroup-Skylar/excelize

yuemanxilou

commit sha c815e4b84b9b777c30d127f384b38105afa2640d

avoid duplicate filter database in workbook defined name

view details

xuri

commit sha 9b7d8463d39ad5fcaae24e5a3b7da296c5e29d17

Merge pull request #638 from yuemanxilou/master avoid duplicate filter database in workbook defined name

view details

push time in 2 months

PR merged 360EntSecGroup-Skylar/excelize

avoid duplicate filter database in workbook defined name

PR Details

<!--- Provide a general summary of your changes in the Title above -->

Description

<!--- Describe your changes in detail -->

Related Issue

<!--- This project only accepts pull requests related to open issues --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please link to the issue here: -->

Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

How Has This Been Tested

<!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. -->

Types of changes

<!--- What types of changes does your code introduce? Put an x in all the boxes that apply: -->

  • [ ] Docs change / refactoring / dependency upgrade
  • [ ] 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

<!--- Go over all the following points, and put an x in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

  • [ ] 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.
+21 -11

0 comment

1 changed file

yuemanxilou

pr closed time in 2 months

more