-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
XLSX file is coming empty but when I repair it is coming fine #1623
Comments
the same issues ,golang v1.21 |
@gengxun, there are some incompatible changes in the Go 1.21.0 encoding/xml library. I have given feedback to the Go team and created a patch for it (golang/go#61881). I suggest waiting for the next Go 1.21.1 minor releases or using the Go 1.20.7 or previous version. Also reference issues #1465, #1595, #1603, #1608, #1614, #1619 and #1620. |
@lakshy-amagi, I've tested with LibreOffice 7.3.7.2, Ubuntu 22.04.1 LTS, and it works well. Please check and make sure your Go version was not 1.21.0. There are any more info to reproduce this issue? |
Thanks, @xuri for the fast response in local I changed the version to 1.20.7 it did the trick but need to check whether it will work in my production. I will let you know if it works until then please don't close this ticket. |
I confirm the problem. I was unpleasantly surprised to see empty sheets.
|
@stvoidit There are some incompatible changes in the Go 1.21.0 encoding/xml library. I have given feedback to the Go team and created a patch for it golang/go#61881, and the Go team has added golang/go#62051 to the Go 1.21.1 milestone. I suggest using the Go 1.20.7 and previous Go released version or waiting for the next Go minor releases. |
Good news! I am glad that there will already be a fix in the next patch. Thank you very much. |
Hi @lakshy-amagi, it seems still not have enough info or feedback to reproduce this issue, so I'll close this issue, if you have any questions, please let me know to reopen this anytime. |
Sorry @xuri for the late response I just deployed it yesterday it is working fine with the golang version 1.20.7. |
Description
I am using github.com/xuri/excelize/v2 v2.7.1
To create the xlsx file
I used simple code
`package main
import (
"fmt"
)
func main() {
f := excelize.NewFile()
defer func() {
if err := f.Close(); err != nil {
fmt.Println(err)
}
}()
// Create a new sheet.
index, err := f.NewSheet("Sheet2")
if err != nil {
fmt.Println(err)
return
}
// 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)
}
}`
But when I open the xlsx file (Books.xlsx) it comes up empty
If I try to repair the xlsx file then data is coming
OS - ubuntu
Go version - go version go1.21.0 linux/amd64
I updated the github.com/xuri/excelize/v2 to latest version v2.7.1
For your reference my go.mod
`module excelize
go 1.21.0
require github.com/xuri/excelize/v2 v2.7.1
require (
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.3 // indirect
github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca // indirect
github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/text v0.12.0 // indirect
)
`
The text was updated successfully, but these errors were encountered: