Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't read column with custom number format. #1658

Closed
peacewalker122 opened this issue Sep 13, 2023 · 7 comments
Closed

Can't read column with custom number format. #1658

peacewalker122 opened this issue Sep 13, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@peacewalker122
Copy link

Description
Can't read column with custom number format. specifically #

Steps to reproduce the issue:

  1. Create a xlsx file with some column using custom number format in my case #

Describe the results you received:
only got the column without custom number format
Describe the results you expected:

Output of go version:
1.21

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

@xuri
Copy link
Member

xuri commented Sep 13, 2023

Thanks for your issue. There are some incompatible changes in the Go 1.21.0, the Excelize library can not work with that version normally. If you are using the Go 1.21.x, please upgrade to the Go 1.21.1 and later version. I have added notice on the README and documentation website for this. In addition, as the documentation of the GetCellValue says, if the cell format can be applied to the value of a cell, the applied value will be returned, otherwise, the original value will be returned. We need to know exactly the custom number format code in your case, if you still got this problem in Go 1.21.1, please provide a standalone example program or reproducible demo if you can.

@xuri xuri added the needs more info This issue can't reproduce, need more info label Sep 13, 2023
@peacewalker122
Copy link
Author

using 1.21.1 same case happening

custom format that i mention

number custom format

code example

f, err := excelize.OpenReader(fileBody)
if err != nil {
	return err
}

rows, err := f.GetRows("Sheet1")
if err != nil {
        return err
}

for i,row := range rows{
	// Do Something
}

@xuri
Copy link
Member

xuri commented Sep 13, 2023

Thanks for your feedback. Could you provide a workbook as a file attachment without confidential info to reproducible this problem?

@peacewalker122
Copy link
Author

example.xlsx

note: the custom format on number column

@xuri xuri added bug Something isn't working in progress Working in progress and removed needs more info This issue can't reproduce, need more info labels Sep 14, 2023
@xuri xuri closed this as completed in 5a039f3 Sep 14, 2023
@xuri
Copy link
Member

xuri commented Sep 14, 2023

I have fixed this issue, please try to upgrade the master branch code, and this patch will be released in the next version.

@xuri xuri removed the in progress Working in progress label Sep 14, 2023
@deanx3
Copy link

deanx3 commented Sep 15, 2023

Hey @xuri , i am using excelize/v2, will this bug be fixed in that version as well? as i am facing the same issue
Thanks in advance

@xuri
Copy link
Member

xuri commented Sep 15, 2023

Hi @deanx3, you can upgrade your Excelize module to the master branch to apply this patch by following command:

go get -u github.com/xuri/excelize/v2@master

jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
- Fix a v2.8.0 regression bug, number format code apply result was empty
- Fix calculate formula functions CHITEST and MMULT panic in some cases
- Updated unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants