qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
18.46k stars 1.73k forks source link

about xlsxWorksheet.DataValidations question #240

Closed rentiansheng closed 6 years ago

rentiansheng commented 6 years ago

Is xlsxWorksheet.DataValidations.DataValidation not reserved for data validation? Why type is string is not an array.

Similar to the following structure:

type xlsxCellDataValidation struct {
    AllowBlank       string  `xml:"allowBlank,attr"`       // allow empty
    ShowInputMessage string  `xml:"showInputMessage,attr"` // 1, true,0,false,  select cell,  Whether the input message is displayed
    ShowErrorMessage string  `xml:"showErrorMessage,attr"` // 1, true,0,false,  input error value, Whether the error message is displayed
    ErrorStyle       *string `xml:"errorStyle,attr"`       //error icon style, warning, infomation,stop
    ErrorTitle       *string `xml:"errorTitle,attr"`       // error title
    Operator         string  `xml:"operator,attr"`         //
    Error            *string `xml:"error,attr"`            // input error value,  notice message
    PromptTitle      *string `xml:"promptTitle"`
    Prompt           *string `xml:"prompt,attr"`
    Type             string  `xml:"type,attr"`  //data type, none,custom,date,decimal,list, textLength,time,whole
    Sqref            string  `xml:"sqref,attr"` //Validity of data validation rules, cell and range, eg: A1 OR A1:A20
    Formula1         string  `xml:"formula1"`   // data validation role
    Formula2         string  `xml:"formula2"`   //data validation role
}
xuri commented 6 years ago

Thanks for your issue. Because this lib not support set data validation currently, so this field hasn't been completely defined yet.

rentiansheng commented 6 years ago

I can understand that this field is not used now. Can I modify his type without regard to compatibility?

xuri commented 6 years ago

I think that unless we define the structure of this field completely, we should continue to use inner string instead.

rentiansheng commented 6 years ago

I see