You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by bo...@lvlomas.com on 2006/09/11 20:31:21 UTC

Opening an existing Excel spreadsheet

I am having a problem when I try and open an existing Excel file.

       ByteArrayOutputStream ba = null;

       FileInputStream fileInputStream = null;

       HSSFWorkbook hssfWorkbook = null;

        ba = new ByteArrayOutputStream();

        fileInputStream = new FileInputStream(
httpServletRequest.getSession().getServletContext().getInitParameter(
"repReviewFile" ) );

        POIFSFileSystem fs = new POIFSFileSystem( fileInputStream );

        hssfWorkbook = new HSSFWorkbook( fs );

On this last line, I get this exception:

rg.apache.poi.hssf.record.RecordFormatException: Unable to construct record
instance, the following exception occured: null

org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:237)


org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:160)


org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)

org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)

Does anyone know why this might be happening.  I have no protection or auto
filters set on the file either.

Thanks.

Bryan


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


AW: Opening an existing Excel spreadsheet

Posted by "KHZ (SAW)" <ka...@sawag.com>.
Hi Brian.

Which version do you use? Possibly the file contains lists. Make a
countercheck with POI 3.0.

Regards,	Karl-Heinz.


-----Ursprüngliche Nachricht-----
Von: boliver@lvlomas.com [mailto:boliver@lvlomas.com] 
Gesendet: Montag, 11. September 2006 20:31
An: poi-user@jakarta.apache.org
Betreff: Opening an existing Excel spreadsheet


I am having a problem when I try and open an existing Excel file.

       ByteArrayOutputStream ba = null;

       FileInputStream fileInputStream = null;

       HSSFWorkbook hssfWorkbook = null;

        ba = new ByteArrayOutputStream();

        fileInputStream = new FileInputStream(
httpServletRequest.getSession().getServletContext().getInitParameter(
"repReviewFile" ) );

        POIFSFileSystem fs = new POIFSFileSystem( fileInputStream );

        hssfWorkbook = new HSSFWorkbook( fs );

On this last line, I get this exception:

rg.apache.poi.hssf.record.RecordFormatException: Unable to construct record
instance, the following exception occured: null

org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:237
)


org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:16
0)


org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)

org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)

Does anyone know why this might be happening.  I have no protection or auto
filters set on the file either.

Thanks.

Bryan


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/