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

get wrong text with GetRows #1533

Closed
KngStr opened this issue Apr 24, 2023 · 9 comments
Closed

get wrong text with GetRows #1533

KngStr opened this issue Apr 24, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@KngStr
Copy link

KngStr commented Apr 24, 2023

Description

We got some problem with wrong cell format.

Steps to reproduce the issue:

rows _ := xlsx.GetRows(xlsx.GetSheetName(0))
fmt.Println(rows)

Use this file for test:Sample.xlsx

Describe the results you received:

年月日

Describe the results you expected:
This is what I got from office

988766248979,
312312333,

Output of go version:

(paste your output here)

Excelize version or commit ID:

787453c6f0b256fdf2c0454a0a694ee79ea52675

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

  • Windows 10
  • office 16
  • go 1.18.2
@xuri xuri added bug Something isn't working in progress Working in progress labels Apr 24, 2023
@xuri xuri closed this as completed in 612f6f1 Apr 25, 2023
@KngStr
Copy link
Author

KngStr commented Apr 25, 2023

Thanks for this quick fix. But it still have some problem.

This bug is not only for date type.
If we change to the other type, it will get wrong text again.

It seems like if SharedString is used, excel will use this instead.

从修复的代码向来看是否不正确?
ms excel中单元格数据如果是引用的SharedString中的则无论单元格式设置为何另存为csv时都会使用SharedString中的数据。
当前修复只排除了日期类型,如果换一种类型则继续出现错误结果。

@xuri
Copy link
Member

xuri commented Apr 25, 2023

Thanks for your feedback. Which type you have changed to? Could you provide a file attachment without confidential info?

@KngStr
Copy link
Author

KngStr commented Apr 25, 2023

Sample2.xlsx

What we got from GetRows

988766248979,,
312312333,日期类型,
312312333312312333,数值类型,
¥312312333312312333,货币类型,
312312333,时间类型,
" ",分数类型,
,,以上数据都引用了sharedString表中的数据,无论单元格格式设置为何都不会影响到结果

What we got from ms excel

988766248979,,
312312333,日期类型,
312312333,数值类型,
312312333,货币类型,
312312333,时间类型,
312312333,分数类型,
,,
,,
,,以上数据都引用了sharedString表中的数据,无论单元格格式设置为何都不会影响到结果

@KngStr
Copy link
Author

KngStr commented Apr 25, 2023

Sorry. We still believe this maybe not the correct one.
SharedString seems like...

@xuri
Copy link
Member

xuri commented Apr 25, 2023

Sorry, I don't understand what's means that "SharedString seems like...". Could you show us cases for more details?

@KngStr
Copy link
Author

KngStr commented Apr 25, 2023

We are wondering if this will be right.

File in xlsx
1
CellTypeSharedString
2
We try to fix
3

@KngStr
Copy link
Author

KngStr commented Apr 25, 2023

Thanks.

xuri added a commit that referenced this issue Apr 25, 2023
- Fix race conditions for concurrency read and write shared string table
- Unit tests has been updated
@xuri
Copy link
Member

xuri commented Apr 26, 2023

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

@xuri xuri removed the in progress Working in progress label Apr 26, 2023
@KngStr
Copy link
Author

KngStr commented Apr 26, 2023

OK. Thanks.

xuri added a commit to JDavidVR/excelize that referenced this issue Jul 11, 2023
- Avoid format text cell value as a numeric
- Fix race conditions for concurrency safety functions
xuri added a commit to JDavidVR/excelize that referenced this issue Jul 11, 2023
…t tokens

- Fix race conditions for concurrency read and write shared string table
- Unit tests has been updated
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
- Avoid format text cell value as a numeric
- Fix race conditions for concurrency safety functions
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
…t tokens

- Fix race conditions for concurrency read and write shared string table
- Unit tests has been updated
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

2 participants