You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Bill Fu <bi...@gmail.com> on 2020/07/02 11:12:19 UTC
sheet.getDataValidations() returns an empty list when a cell is
validated by a sequence on another sheet
Hi, POI team.
I have a question for you. Please help me to take a look at it.
There is a workbook with two sheets:
1. Sheet1
2. Sheet2
And there is a sequence on Sheet2 at the range of A1 to A5:
- aa
- bb
- cc
- dd
- ee
And in Sheet1, the cell A1 is validated by the sequence in Sheet2.
Excel screenshot <https://i.stack.imgur.com/qxc9S.png>
However, sheet.getDataValidations() returns an empty list for this case.
Did I miss something?
public static void main(String[] args) throws Exception {
String filePath = "/Users/fujiexiang/ExcelWorkbook.xlsx";
Workbook workbook = WorkbookFactory.create(new
FileInputStream(filePath));
Sheet sheet = workbook.getSheetAt(0);
System.out.println("" + dataValidations + " " + dataValidations.size());
}
"[] 0" was printed out.
Warmly regards
Bill Fu