sheet.getDataValidations() returns an empty list when a cell is validated by a sequence on another sheet

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

sheet.getDataValidations() returns an empty list when a cell is validated by a sequence on another sheet

Bill Fu
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