Menu

#250 XlsTable - empty excel columns cause problem

v2.2
closed-fixed
Bug (232)
5
2009-09-01
2009-07-09
No

The createMetaData method in the XlsTable class contains:

HSSFCell cell = sampleRow.getCell((short)i);
if (cell == null)
{
break;
}
The sampleRow.getCell does not return null for columns that are not empty in Excel but do contain formatting, such as aligning the cell contents to the right. Dbunit subsequentely tries to insert data into a column with an empty string as name and throws an exception:

org.dbunit.dataset.NoSuchColumnException: MY_TABLE.
at org.dbunit.operation.AbstractOperation.getOperationMetaData(AbstractOperation.java:71)

This problem could be fixed if the above code would check the object and only add it to the column list if cell.getStringCellValue() doesn't return an empty string.

This is not a blocking issue as clearing the formatting in the cell solves the problem, but it's quite annoying.

I used dbunit 2.2 but the source code in 2.4.5 seems unchanged, so I assume this issue still exists there.

Btw, 2.4.5 is not in the version list of this bug tracker, it onl goes to 2.3.0

Discussion

  • matthias g

    matthias g - 2009-08-17
    • status: open --> pending-fixed
     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.