You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an empty Excel file I want to fill which contains cells with formatting.
Now my application either calls a function which saves less data (one save call) or more data (more than one save call).
In the first use case everything works as expected.
In the second use case where my application has more than one save calls, excelize will save the values on unexpected cells.
But only the values after the first save call are found on the wrong cells.
Steps to reproduce the issue:
Open a formatted excel file
Set some values and call Save()
Set more values and call Save() again
Describe the results you received:
After first Save() call the values are saved on unexpected cell.
For example: Save a value on Z12 will save the value on AS12.
Describe the results you expected:
Save a value on Z12 should be found on Z12.
Output of go version:
tested with go1.22
Excelize version or commit ID:
v2.5.0 the bug exist
<= v2.5.0 the bug doesn't exist
Before the first Save() call f.checked.Load will return false and than ws.checkRow will fill ws.sheetData.R.C with the missing cells.
After the first Save() call f.checked.Load will return true and ws.checkRow will not be called.
This is the reason why the SetCellStr will write on the wrong cell because only the formatted cells are found in ws.sheetData.R.C.
I attached you my sample project to reproduce the issue.
I'm curious to here from you.
Thanks for your issue. This issue was introduced by commit d9a0da7sheet.go:L170 in v2.8.1, the v2.8.0 works well. I have fixed it, please upgrade to the master branch code, and this path will be released in the next version.
Description
I have an empty Excel file I want to fill which contains cells with formatting.
Now my application either calls a function which saves less data (one save call) or more data (more than one save call).
In the first use case everything works as expected.
In the second use case where my application has more than one save calls, excelize will save the values on unexpected cells.
But only the values after the first save call are found on the wrong cells.
Steps to reproduce the issue:
Save()
Save()
againDescribe the results you received:
After first
Save()
call the values are saved on unexpected cell.For example: Save a value on
Z12
will save the value onAS12
.Describe the results you expected:
Save a value on
Z12
should be found onZ12
.Output of
go version
:tested with go1.22
Excelize version or commit ID:
bug reason
I could break down your code to
excelize/excelize.go
Line 294 in 5f58354
Before the first
Save()
callf.checked.Load
will returnfalse
and thanws.checkRow
will fillws.sheetData.R.C
with the missing cells.After the first
Save()
callf.checked.Load
will returntrue
andws.checkRow
will not be called.This is the reason why the
SetCellStr
will write on the wrong cell because only the formatted cells are found inws.sheetData.R.C
.I attached you my sample project to reproduce the issue.
I'm curious to here from you.
bug.zip
The text was updated successfully, but these errors were encountered: