-
Notifications
You must be signed in to change notification settings - Fork 818
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
Not Able to Write Last Cell in Pivot Table #809
Comments
Same here for idx, event := range events {
col := idx+1
eventColIndexes[event.ID] = col
cell := Must2(sh.Cell(0, col))
cell.SetDate(event.Date)
cell.SetFormat("d.m.")
}
for idx, member := range members {
row := idx+1
memberRowIndexes[member.ID] = row
cell := Must2(sh.Cell(row, 0))
cell.SetString(member.Name)
}
for _, attendance := range attendances {
row := memberRowIndexes[attendance.MemberID]
col := eventColIndexes[attendance.EventID]
cell := Must2(sh.Cell(row, col))
switch attendance.Status {
case AttendancePresent:
cell.SetString("A")
cell.GetStyle().Fill.PatternType = "solid"
cell.GetStyle().Fill.FgColor = xlsx.RGB_Dark_Green
cell.GetStyle().Font.Color = xlsx.RGB_Black
case AttendanceLate:
cell.SetString("H")
cell.GetStyle().Fill.PatternType = "solid"
cell.GetStyle().Fill.FgColor = xlsx.RGB_Light_Green
cell.GetStyle().Font.Color = xlsx.RGB_Black
case AttendanceExcused:
cell.SetString("E")
cell.GetStyle().Fill.PatternType = "solid"
cell.GetStyle().Fill.FgColor = xlsx.RGB_Light_Red
cell.GetStyle().Font.Color = xlsx.RGB_Black
case AttendanceNotExcused:
cell.SetString("X")
cell.GetStyle().Fill.PatternType = "solid"
cell.GetStyle().Fill.FgColor = xlsx.RGB_Dark_Red
cell.GetStyle().Font.Color = xlsx.RGB_White
}
} |
Sorry for the delayed response. Looking into this now. |
OK, so the first thing to know is that if you reverse the order you write in (go breadth first) then the problem goes away. It appears that the final row doesn't get appended to the cellstore when we step back from it to the first row. Trying to find out why now. |
tealeg
added a commit
that referenced
this issue
Sep 14, 2024
tealeg
added a commit
that referenced
this issue
Sep 14, 2024
Fixed issue #809, losing rows from cellstore when moving backwards
Thank you @tealeg ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the following code:
As you can see I'm trying to write three colors ("Red", "Green" and "Blue") as the Y axis.
However the resulting file looks like this, with the last color is missing.
Interestingly, I'm able to write the last color if I either write the X axis first, or don't write the X axis at all.
Go version: v1.18
Xlsx version: v3.3.7
Is this expected behaviour? Am I missing some sort of row allocating step?
The text was updated successfully, but these errors were encountered: