You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2012/03/14 15:06:14 UTC
DO NOT REPLY [Bug 51693] Missing column
https://issues.apache.org/bugzilla/show_bug.cgi?id=51693
--- Comment #1 from perceval.barbu@gmail.com 2012-03-14 14:06:14 UTC ---
Hi,
The issue concerns only files with an even number of column.
If you create a small file (2 or 4 cells in a row), import data doesn't find
last column.
I simulate ODBC connection via excel 2003
Menu Data > External data > Import data
import_2_col_expected.xls => KO (1 cell) cell_1
import_3_col_expected.xls => OK (3 cell) cell_1,cell_2,cell_3
import_4_col_expected.xls => KO (3 cell) cell_1,cell_2,cell_3
import_5_col_expected.xls => OK (5 cell) cell_1,cell_2,cell_3,cell_4,cell_5
Here is the code to create small test import file.
// Create test files
public static void main(String[] args) {
try {
for (int nbCol = 2; nbCol < 6; nbCol++) {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFRow row = wb.createSheet("test").createRow(0);
for (int i = 0; i < nbCol; i++)
row.createCell(i).setCellValue("cell_" + (i + 1));
String filename = "/tmp/import_" + nbCol + "_col_expected.xls";
System.out.println("writing " + filename);
FileOutputStream out = new FileOutputStream(filename);
wb.write(out);
out.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org