Bug 7755 - Boolean Cells are ignored when reading .xls file
Summary: Boolean Cells are ignored when reading .xls file
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-05 03:41 UTC by Doug Bitting
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Doug Bitting 2002-04-05 03:41:45 UTC
I have an Excel 2000 file with 10 columns, 2 of which are boolean.  For the 
particular row in question, HSSFRow.getPhysicalNumberOfCells() reports 8 
cells.  The boolean cells are returned as <code>null</code> from HSSFRow.getCell
().
Comment 1 Glen Stampoultzis 2002-04-08 14:23:32 UTC
Here's a test case that confirms the bug.  A comment in the code indicates that 
this bug may be a known issue.

public void testReadBooleans()
            throws Exception
    {
        HSSFWorkbook workbook = new HSSFWorkbook();
        HSSFSheet sheet = workbook.createSheet("Test boolean");
        HSSFRow row = sheet.createRow((short)2);
        HSSFCell cell = row.createCell((short)9);
        cell.setCellValue(true);
        cell = row.createCell((short)11);
        cell.setCellValue(true);
        File tempFile = File.createTempFile("bool", "test.xls");
        FileOutputStream stream = new FileOutputStream(tempFile);
        workbook.write(stream);
        stream.close();

        FileInputStream readStream = new FileInputStream(tempFile);
        workbook = new HSSFWorkbook(readStream);
        sheet = workbook.getSheetAt(0);
        row = sheet.getRow(2);
        stream.close();
        tempFile.delete();
        assertEquals(2, row.getPhysicalNumberOfCells());


    }
Comment 2 Glen Stampoultzis 2002-04-10 12:29:33 UTC
Nope, not a known issue...  I think it may have been my fault.  BoolErr record 
was missing from the RecordGenerator class.  I will be submitting a fix as soon 
as CVS finishes updating (which could take a while over my 33.6k modem.
Comment 3 Glen Stampoultzis 2002-04-10 13:00:17 UTC
Fixed.  Will be available on upcoming 1.5 release.