我希望两个单元格之间的单元格值。 我使用HSSFDataValidation进行集验证,以便通过apache poi创建excel文件,但执行时出错。
源代码:
HSSFDataValidationHelper dvHelper = new HSSFDataValidationHelper(sheet);
DVConstraint dvConstraint =(DVConstraint) dvHelper.createNumericConstraint
(DataValidationConstraint.ValidationType.DECIMAL,
DataValidationConstraint.OperatorType.BETWEEN,
"G3",
"H3");
CellRangeAddressList addressList=new CellRangeAddressList (2,rowNum,8,8);
DataValidation validation =dvHelper.createValidation(dvConstraint, addressList);
validation.setSuppressDropDownArrow(false);
validation.setShowErrorBox(true);
sheet.addValidationData(validation);
错误:
The supplied text 'G3' could not be parsed as a number
答案 0 :(得分:0)
将此格式用于公式:"=$G$3"
和"=$H$3"