您能否建议我如何在 Excel 工作表列中使用 POI 3.6 创建下拉列表?
提前致谢。
尝试这个,
{
CellRangeAddressList addressList =
new CellRangeAddressList(1,10,columnIndexFromHeaderList,columnIndexFromHeaderList);
DVConstraint dvConstraint =
DVConstraint.createExplicitListConstraint(stringArray);
dataValidation = new HSSFDataValidation(addressList,dvConstraint);
dataValidation.setSuppressDropDownArrow(false);
sheet.addValidationData(dataValidation );
}