We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description
开发者你好,我在使用该库的过程中,发现具有以下特点的文件:
在调用(f *File) RemoveCol方法后无法使用MS Office正常打开,如Steps to reproduce the issue所示。
(f *File) RemoveCol
我尝试定位了问题产生的原因,发现对于数据验证的下拉列表 MS Office会将其保存为: 而WPS Office则会保存为:
因此,对于WPS Office生成的文件,在调用(f *File) adjustDataValidations时,对formula的转义会不正确,进而导致该问题。
(f *File) adjustDataValidations
我提了一个PR以修复该问题,经过测试修复后的代码能够使xlsx文件被正确打开。但不确定会不会有别的坑是我没注意到的,烦请帮忙review一下。
Steps to reproduce the issue:
func TestXxx(t *testing.T) { bs, err := os.ReadFile("./test111.xlsx") assert.Nil(t, err) file, err := OpenReader(bytes.NewReader(bs)) assert.Nil(t, err) err = file.RemoveCol("Sheet2", "A") assert.Nil(t, err) buf, err := file.WriteToBuffer() assert.Nil(t, err) err = os.WriteFile("tttt.xlsx", buf.Bytes(), 0644) assert.Nil(t, err) }
使用MS office无法正确打开生成的xlsx:
使用 WPS office 能够打开,但下拉框无法正确下拉
Output of go version:
go version
go version go1.21.6 darwin/arm64
Excelize version or commit ID:
3e636ae7b20285d4efb3d21bba0e1c165318f9f8
Environment details (OS, Microsoft Excel™ version, physical, etc.):
GOARCH='arm64' GOHOSTARCH='arm64' GOHOSTOS='darwin' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/30/cmv9c_5j3mq_kthx63sb1t5c0000gn/T/go-build1186998755=/tmp/go-build -gno-record-gcc-switches -fno-common'
The text was updated successfully, but these errors were encountered:
This closes qax-os#1879, compatible with the escaped quote symbol in …
d486704
…none formula data validation rules - Update dependencies module to fix vulnerabilities - Update unit tests
This closes #1879, compatible with the escaped quote symbol in none f…
f8487a6
…ormula data validation rules (#1880) - Update dependencies module to fix vulnerabilities - Update unit tests Co-authored-by: houjianxin.rupert <houjianxin.rupert@bytedance.com>
Thanks for your issue and pull request. The pull request has been merged, and this patch will be released in the next version.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Description
开发者你好,我在使用该库的过程中,发现具有以下特点的文件:
在调用
(f *File) RemoveCol
方法后无法使用MS Office正常打开,如Steps to reproduce the issue所示。我尝试定位了问题产生的原因,发现对于数据验证的下拉列表
MS Office会将其保存为:
而WPS Office则会保存为:
因此,对于WPS Office生成的文件,在调用
(f *File) adjustDataValidations
时,对formula的转义会不正确,进而导致该问题。我提了一个PR以修复该问题,经过测试修复后的代码能够使xlsx文件被正确打开。但不确定会不会有别的坑是我没注意到的,烦请帮忙review一下。
Steps to reproduce the issue:
使用MS office无法正确打开生成的xlsx:
使用 WPS office 能够打开,但下拉框无法正确下拉
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):
The text was updated successfully, but these errors were encountered: