Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Validation cannot handle double quote #1369

Open
4 tasks
zsolthungary opened this issue Jun 24, 2024 · 0 comments
Open
4 tasks

Validation cannot handle double quote #1369

zsolthungary opened this issue Jun 24, 2024 · 0 comments

Comments

@zsolthungary
Copy link

zsolthungary commented Jun 24, 2024

NPOI Version

2.7.0

File Type

  • [x ] XLSX
  • XLS
  • DOCX
  • XLSM
  • OTHER

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants