Skip to content

Commit

Permalink
fix the issue that cannot emit MergeCells and DataValidations together
Browse files Browse the repository at this point in the history
  • Loading branch information
sfwn committed Oct 16, 2023
1 parent e01f87e commit b3d7083
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 b3d7083

Please sign in to comment.