Fix invalid formula in data validation drop list

This commit is contained in:
xuri 2019-07-22 22:36:44 +08:00
parent 35e485756f
commit c1357ee58f
No known key found for this signature in database
GPG Key ID: BA5E5BB1C948EDF7
1 changed files with 2 additions and 2 deletions

View File

@ -141,12 +141,12 @@ func (dd *DataValidation) SetRange(f1, f2 int, t DataValidationType, o DataValid
//
// dvRange := excelize.NewDataValidation(true)
// dvRange.Sqref = "A7:B8"
// dvRange.SetSqrefDropList("E1:E3", true)
// dvRange.SetSqrefDropList("$E$1:$E$3", true)
// f.AddDataValidation("Sheet1", dvRange)
//
func (dd *DataValidation) SetSqrefDropList(sqref string, isCurrentSheet bool) error {
if isCurrentSheet {
dd.Formula1 = sqref
dd.Formula1 = fmt.Sprintf("<formula1>%s</formula1>", sqref)
dd.Type = convDataValidationType(typeList)
return nil
}