我正在尝试在apache poi上填充数据验证的下拉列表。
Name namedRange = workbook.createName();
namedRange.setNameName("myList");
namedRange.setRefersToFormula("'lookupSheet'!$B$4:$B$(LOOKUP(2;1/(B:B<>\"\");ROW(B:B))");
XSSFDataValidationHelper dvHelper = new XSSFDataValidationHelper(sheet);
XSSFDataValidationConstraint dvConstraint = (XSSFDataValidationConstraint)
dvHelper.createFormulaListConstraint("myList");
这是我面临的例外:
org.apache.poi.ss.formula.FormulaParseException: Parse error near char 17 '$' in specified formula ''lookupSheet'!$A$4:$A$(LOOKUP(2;1/(B:B<>"");ROW(B:B))'. Expected number, string, or defined name
我知道错误非常清楚,但我看不出有什么问题。
提前致谢。