I believe I've found a bug in version 3.5-Beta5. It is related to reading
columns in spreadsheets with large numbers of columns. (FYI, it looks like
it might be related to a bug reported as fixed for 3.5-Beta5 on the Changes
page: "Fixed XSSFCell to properly handle cell references with column numbers
up to XFD(POI-DEVELOPERS)". If this is the same bug, please be aware that
it doesn't seem to be fixed in 3.5-Beta5 at least with respect to the Apache
POI jars in the Maven Central Repo.
Details:
1. I created a spreadsheet and put values in the first row from cell "A1" to
column "CRD1". In my case, I put "COLUMN1" in "A1", "COLUMN2" in "A2", up
to "COLUMN2500" in "CRD1". In other words, there was a value in each of the
first 2500 columns of the first row.
2. I then executed the following snippet against the spreadsheet:
File xlsxFile = new File("xlsx_loader_test.xlsx");
Workbook wb = new XSSFWorkbook(xlsxFile.getAbsolutePath());
Sheet sheet = wb.getSheet("Sheet1");
Row row = sheet.getRow(0);
int i = 0;
for (Cell cell : row) {
System.out.println("Column " + ++i + " value: " + cell.toString());
}
3. Output Expected: 2500 printed lines as follows:
Column 1 value: COLUMN1
Column 2 value: COLUMN2
.
Column 2500 value: COLUMN2500
4. Actual Output: 702 printed lines as follows:
a. First 26 lines printed as expected
b. Lines 27 to 96 printed values of cells "AAZ1" to "CRD1" in increments of
26. For example:
Column 27 value: COLUMN728
Column 28 value: COLUMN754
To Reproduce: I have put together a small Maven2 project that demonstrates
the problem. I can zip it up and send it to any contributer who is willing
to look into it. Contact me directly and I will email it to you. All you
would need to do is unzip it on a computer with Maven2 installed and execute
from the command line: mvn package