Skip to content
New issue

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

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

Already on GitHub? Sign in 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

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

No branches or pull requests

2 participants