标签:sheet created ssl date address first erro oid sha
npoi设置数据有效性
public void SetDataValidate(ISheet sheet, int firstCol, int lastCol) { CellRangeAddressList regions = new CellRangeAddressList(1, 65535, firstCol, lastCol); DVConstraint constraint = DVConstraint.CreateDateConstraint( (int)ComparisonOperator.Between, "1900-01-01", "2999-12-31", "yyyy-MM-dd"); HSSFDataValidation dataValidate = new HSSFDataValidation(regions, constraint);
dataValidate.EmptyCellAllowed = false; dataValidate.CreateErrorBox("错误提示", "请输入日期‘yyyy年MM月dd日‘"); sheet.AddValidationData(dataValidate); }
标签:sheet created ssl date address first erro oid sha
原文地址:https://www.cnblogs.com/guohu/p/9639631.html