Hi, I am getting File error: Data may have been lost while opening an excel file. My java code gets the file from db, which is put in by another application in VB. The VB team keeps on adding lots of formulae to the sheet, when webapp reads, the POI doesn't understand all of them and throws above error. Even though I debug with eclipse, I am unable to figure out which record teh POI doesn't understand. The data is chunks of byte arrays and all numbers in hex. I tried using biffViwer, it generated lots of unknown records, how do I read these numbers to figure out which record is corrupt. How do i read recordid below ? How do I know which records or values are bad for POI ?? -----UNKNOWN---------------------------------- Offset 0xa8 (168) recordid = 0x13d, size = 28 [TABID] .elements = 14 .element_0 = 41 .element_1 = 39 .element_2 = 176 .element_3 = 37 .element_4 = 223 .element_5 = 10 .element_6 = 217 .element_7 = 145 .element_8 = 215 .element_9 = 216 .element_10 = 224 .element_11 = 221 .element_12 = 222 .element_13 = 218 [/TABID] -----UNKNOWN---------------------------------- Thanks for your time, Sujatha.
Sujatha, Can you please download the latest code from CVS, there are a number of changes to how the records are read and on the whole it seems like it has fixed a number of corruption issues as well. If that code still reports an error, please attach a sample spreadsheet to this bug that cant be read by HSSF. Jason
Hi Jason, Thanks for the reply. The excel file was re-written by VB team by reviewing all the macros and formulae. The POI is now able to read this file. So the problem is solved for now ... but may occur again, in which case I will send you the file. Tx, Sujatha (In reply to comment #0) > Hi, > I am getting File error: Data may have been lost while opening an excel file. > My java code gets the file from db, which is put in by another application in > VB. The VB team keeps on adding lots of formulae to the sheet, when webapp > reads, the POI doesn't understand all of them and throws above error. > Even though I debug with eclipse, I am unable to figure out which record teh > POI doesn't understand. The data is chunks of byte arrays and all numbers in > hex. I tried using biffViwer, it generated lots of unknown records, how do I > read these numbers to figure out which record is corrupt. How do i read > recordid below ? How do I know which records or values are bad for POI ?? > -----UNKNOWN---------------------------------- > Offset 0xa8 (168) > recordid = 0x13d, size = 28 > [TABID] > .elements = 14 > .element_0 = 41 > .element_1 = 39 > .element_2 = 176 > .element_3 = 37 > .element_4 = 223 > .element_5 = 10 > .element_6 = 217 > .element_7 = 145 > .element_8 = 215 > .element_9 = 216 > .element_10 = 224 > .element_11 = 221 > .element_12 = 222 > .element_13 = 218 > [/TABID] > -----UNKNOWN---------------------------------- > Thanks for your time, > Sujatha.
As indicated CVS/SVN has fixed the issue. Still working hard to fix all ocorruption issues. Jason