Open zsolthungary opened 2 months ago
2.7.0
Please attach your original Excel File to help us reproduce the issue
Here is the code: CellRangeAddressList addressList = new CellRangeAddressList(); addressList.AddCellRangeAddress(1, 12, 1, 12); XSSFDataValidationHelper helper = new XSSFDataValidationHelper(pSheet); XSSFDataValidationConstraint constraint = (XSSFDataValidationConstraint)helper.CreateExplicitListConstraint( listConstraintValues); XSSFDataValidation validation = (XSSFDataValidation)helper.CreateValidation(constraint, addressList);
validation.ShowErrorBox = true; validation.CreateErrorBox("Title", pErrorMsg); validation.SuppressDropDownArrow = pIsSuppressDropDownArrow; pSheet.AddValidationData(validation);
if listConstraintValues contains double quote (") in a form that c# can handle (\"), then excel will return error. Excel uses double quote different way. See excel attached: M2 cell should be validated Without double quote it works fine. Error.xlsx
NPOI Version
2.7.0
File Type
Upload the Excel File
Please attach your original Excel File to help us reproduce the issue
Reproduce Steps
Here is the code: CellRangeAddressList addressList = new CellRangeAddressList(); addressList.AddCellRangeAddress(1, 12, 1, 12); XSSFDataValidationHelper helper = new XSSFDataValidationHelper(pSheet); XSSFDataValidationConstraint constraint = (XSSFDataValidationConstraint)helper.CreateExplicitListConstraint( listConstraintValues); XSSFDataValidation validation = (XSSFDataValidation)helper.CreateValidation(constraint, addressList);
validation.ShowErrorBox = true; validation.CreateErrorBox("Title", pErrorMsg); validation.SuppressDropDownArrow = pIsSuppressDropDownArrow; pSheet.AddValidationData(validation);
Issue Description
if listConstraintValues contains double quote (") in a form that c# can handle (\"), then excel will return error. Excel uses double quote different way. See excel attached: M2 cell should be validated Without double quote it works fine. Error.xlsx