Skip to content

Commit

Permalink
Merge pull request #785 from sfwn/fix/xmlworksheet-mergecells-dataval…
Browse files Browse the repository at this point in the history
…idations

fix the issue that cannot emit MergeCells and DataValidations together
  • Loading branch information
tealeg authored Oct 20, 2023
2 parents e01f87e + b3d7083 commit 8086d9b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xmlWorksheet.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,14 +760,18 @@ func (worksheet *xlsxWorksheet) WriteXML(xw *xmlwriter.Writer, s *Sheet, styles
if err != nil {
return err
}
return xw.Write(mergeCells)
if err := xw.Write(mergeCells); err != nil {
return err
}
}
if worksheet.DataValidations != nil {
dataValidation, err := emitStructAsXML(reflect.ValueOf(worksheet.DataValidations), "dataValidations", "")
if err != nil {
return err
}
return xw.Write(dataValidation)
if err := xw.Write(dataValidation); err != nil {
return err
}
}
return nil
}(),
Expand Down

0 comments on commit 8086d9b

Please sign in to comment.