I am working on a Java application where I use Apache POI to create Excel sheets with cascading dropdowns. The goal is to dynamically update the dropdown values based on the selection of a higher-level dropdown. However, I am facing an issue with the #Name error in Excel when trying to implement this cascading behavior.
Implementation Details:
- Dropdown Values Retrieval: I am retrieving all dropdown values for District, Taluka, and Village.
- Hidden Sheet Creation: I am creating a hidden sheet for District, Taluka, and Village.
- Formulas: I am applying the following formulas:
Taluka: INDIRECT(INDEX(TalukaDropdown, MATCH($E$2, DistrictDropdown, 0)))
Village: INDIRECT(INDEX(VillageDropdown, MATCH($F$2, TalukaDropdown, 0)))
DataValidationHelper validationHelper = sheet.getDataValidationHelper();
CellRangeAddressList talukaAddressList = new CellRangeAddressList(rowNumber + 1, 1000, talukaColumnIndex, talukaColumnIndex);
DataValidationConstraint talukaConstraint = validationHelper.createFormulaListConstraint(talukaFormula);
DataValidation talukaValidation = validationHelper.createValidation(talukaConstraint, talukaAddressList);
Problem Statement:
While the sheet is generating successfully, the dropdown values for Taluka and Village are displaying #Name instead of the actual values.
I would appreciate any insights or suggestions on how to resolve the #Name error and ensure that the dropdown values are displayed correctly.