Bug 55273 - Names referring to Excel tables have no associated sheet
Summary: Names referring to Excel tables have no associated sheet
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.10-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-16 20:47 UTC by Martin Studer
Modified: 2016-06-15 16:37 UTC (History)
0 users



Attachments
Excel file used for reproduction of issue (9.24 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2013-07-16 20:47 UTC, Martin Studer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Studer 2013-07-16 20:47:26 UTC
Created attachment 30596 [details]
Excel file used for reproduction of issue

Names that refer to Excel tables (Excel 2007+) have no associated sheet although an Excel table is linked to a worksheet.


See the following example:

XSSFWorkbook wbook = (XSSFWorkbook) WorkbookFactory.create(new File("ExcelTables.xlsx")); // file attached
Name nm = wbook.getName("TableAsRangeName");
System.out.println(nm.getRefersToFormula()); // gives TableName[#All]
System.out.println(nm.getSheetName()); // gives null ...
// ... although tables are associated to a worksheet
for(XSSFTable t : wbook.getSheet("ExcelTable").getTables()) {
  System.out.println(t.getName());
}
Comment 1 Javen O'Neal 2016-06-15 16:37:58 UTC
Added disabled unit test in r1748606. This fails on POI 3.15-beta 2 because CellReference is used to parse the sheet name from "TableName[#All]", but cannot handle this cell reference format.