I need all Excel sheet Names (what r all contains the datas) using POI jar. Like jxl jar - getSheetNames()
You don't say how you want them, so I'll guess at a list. You just need to iterate over the sheet indicies, getting the name for each. Your code would be something like:
File myFile = new File("/path/to/excel.xls");
Workbook wb = WorkbookFactory.create(myFile);
List<String> sheetNames = new ArrayList<String>();
for (int i=0; i<wb.getNumberOfSheets(); i++) {
sheetNames.add( wb.getSheetName(i) );
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With