Hi Luca, Could you please tell me if you found the solution for this. Its a long time which you posted it. Unfortunately I am facing the same problem when using poi 3.0.1. Thanks Krishna
luca finzi contini wrote: > > Hi all, > i'm using POI 2.5.1 to create and read XLS files. > The xls file lifecycle is: > - creation in my Java app; > - activeSync'ing to a handheld device --> xls gets > converted to Pocket Excel pxl format > - modifying the file on the handheld > - Active syncing back to the PC --> pxl file gets > re-converted to xls Excel 97/2000 format. > > Then I try to read the xls with my java app. > I used the code in the example at HSSF: > ... > FileInputStream inputStream = new > FileInputStream(fileName); > POIFSFileSystem fs = new POIFSFileSystem( > inputStream ); > HSSFWorkbook wb = new HSSFWorkbook(fs); > ... > > > I get the following exception: > java.io.IOException: Unable to read entire block; 295 > bytes read; expected 512 bytes > > at > org.apache.poi.poifs.storage.RawDataBlock.<init>(RawDataBlock.java:98) > > at > org.apache.poi.poifs.storage.RawDataBlockList.<init>(RawDataBlockList.java:88) > > at > org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:123) > > at .... > > I found that if I open the problematic xls file with > Excel and re-save it, it all works fine. > I cannot do that in production! ;-) I need to parse > the file directly through my app. > Any suggestions will be highly appreciated! > Thank you all in advance! > Luca. > > > > > > > > ___________________________________ > Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB > http://mail.yahoo.it > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > Mailing List: http://jakarta.apache.org/site/mail2.html#poi > The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ > > > -- View this message in context: http://www.nabble.com/XLS-reading-problem%21-tp1514698p25361739.html Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
