这个性别我想输入别的值,但是excel会提示我有数据有效性验证,请问怎么去掉这个验证,我想要有下拉列表的同时还能可以支持手动输入。
以下是代码
private int createAddressList1(String[] zdxmcList, String[] zdmcList, HSSFSheet dataSheet, HSSFSheet hiddenSheet, int constraintIndex, int rangeIndex) {
int startConstraintIndex = constraintIndex + 1;
int len = zdxmcList.length;
for (int i = 0; i < len; ++i) {
String zdxmc = zdxmcList[i];// 字典项名称
// String zdxbm = zdxbmList[i];// 字典项编码
HSSFRow row = hiddenSheet.createRow(constraintIndex);
HSSFCell cell = row.createCell(0);
cell.setCellValue(new HSSFRichTextString(zdxmc));
HSSFCell cell2 = row.createCell(1);
cell2.setCellValue(new HSSFRichTextString(zdmcList[i]));
constraintIndex++;
}
int endConstraintIndex = constraintIndex + 1;
CellRangeAddressList regions = new CellRangeAddressList(FIRST_DATA_ROW, FIRST_DATA_ROW + Constants.ROW_LIMIT - 1, rangeIndex, rangeIndex);
DVConstraint constraint = DVConstraint.createFormulaListConstraint("INDIRECT(\"" + HIDDEN_SHEET_NAME + "!$A$" + startConstraintIndex + ":$A$" + endConstraintIndex + "\")");
HSSFDataValidation dataValidation = new HSSFDataValidation(regions, constraint);
dataSheet.addValidationData(dataValidation);
return constraintIndex;
}