|Summary:||XmlValueOutOfRangeException calling getDataValidations for custom validations with XSSFSheet|
|Product:||POI||Reporter:||Stuart Owen <sowen>|
|Component:||XSSF||Assignee:||POI Developers List <dev>|
Description Stuart Owen 2012-10-04 13:55:02 UTC
I've encountered a problem using custom Data Validations with XSSF sheets. Adding the validation seems to work OK, but afterwards when I try getValidations I get an XmlValueOutOfRangeException (full stack trace below). The contents of the validation formula doesn't seem to matter, and things seem to work correctly if I load a xlsx workbook containing custom validations and then try to access them. Here is some simplified example code that demonstrates the problem: XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); sheet.getDataValidations(); //<-- works //create the cell that will have the validation applied sheet.createRow(0).createCell(0); DataValidationHelper dataValidationHelper = sheet.getDataValidationHelper(); DataValidationConstraint constraint = dataValidationHelper.createCustomConstraint("SUM($A$1:$A$1) <= 3500"); CellRangeAddressList addressList = new CellRangeAddressList(0, 0, 0, 0); DataValidation validation = dataValidationHelper.createValidation(constraint, addressList); sheet.addValidationData(validation); sheet.getDataValidations(); //<-- raised XmlValueOutOfRangeException I also have the same problem when operating on an exisiting workbook that contains sheets and cells, I've just simplified the code above.
Comment 2 Stuart Owen 2012-10-12 15:04:34 UTC
Trying the nightly build (20121011), I can confirm that this is now fixed. Thanks Yegor.