poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kommineni, Sateesh \(GE Consumer & Industrial\)" <sateesh.kommin...@ge.com>
Subject RE: org.apache.poi.hssf.record.RecordFormatException in Reading/Writing to an Excel File..
Date Mon, 02 Feb 2004 13:21:42 GMT
Hi Andrew,

   Thanks for your reply.. I am able to get the BufferedInputStream, the path and FILE_NAME
are getting passed correctly in both Windows and Solaris .
 If the path is incorrect i won't get the output
   bin=java.io.BufferedInputStream@1118aa5

  Pls let me know if you have some other thoughts..

Thanks
Sateesh


-----Original Message-----
From: Andrew Kharchuk [mailto:aka@ukraina.com]
Sent: Monday, February 02, 2004 6:47 PM
To: POI Users List
Subject: Re: org.apache.poi.hssf.record.RecordFormatException in
Reading/Writing to an Excel File..


Hi.

I think  your problem is the following - you have wrong file path  when you
create object using  new FileInputStream(path+FILE_NAME)

----- Original Message ----- 
From: "Kommineni, Sateesh (GE Consumer & Industrial)"
<sateesh.kommineni@ge.com>
To: <poi-user@jakarta.apache.org>
Sent: Monday, February 02, 2004 3:04 PM
Subject: org.apache.poi.hssf.record.RecordFormatException in Reading/Writing
to an Excel File..


Hi,

    I am try to read an Excel File and then writing to it. It is working
well in Windows and giving problems in Solaris. The Exception it is giving
is:

  . bin=java.io.BufferedInputStream@1118aa5
415. Excep in generating the
WorkBook=org.apache.poi.hssf.record.RecordFormatException: Unable to
construct record instance, the following exception occured: null
416. RecordFormatExcep in
createWorkBook=org.apache.poi.hssf.record.RecordFormatException: Unable to
construct record instance, the following exception occured: null
417. Work Book=null

  The Code i am using is given below:

  try{
bin  = new BufferedInputStream(new FileInputStream(path+FILE_NAME));
System.out.println("bin="+bin);
    wb   = new HSSFWorkbook(bin,false);
}
catch(Exception ioe){
   System.out.println("Excep in generating the WorkBook="+ioe);
   ioe.printStackTrace();
try{
  fs  = new POIFSFileSystem(new FileInputStream(path+FILE_NAME));
    wb = new HSSFWorkbook(fs);
       }
catch(RecordFormatException rfe){
System.out.println("RecordFormatExcep in createWorkBook="+rfe);
rfe.printStackTrace();
}
catch(Exception e){
    System.out.println("Excep IS="+e);
    e.printStackTrace();
}
}
finally{
   if(bin!=null) bin.close();
}
System.out.println("Work Book="+wb);


   Pls let me know what went wrong..

Thanks a lot
Sateesh


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Mime
View raw message