Hello Roberto, I have been following your conversation with Fillipo and would like to ask a couple of questions please.
In one of your replies, you said; Hi, I don't know how the file is saved (is automatically generated by an ASPX page, with excel xml format) because i download it from the web.... If the file is in the xml format then you do not want to be using HSSF to process it but XSSF. HSSF is designed to work with the older binary file format not the new OpenXML based file format. You need to change the code that you have written to use XSSFWorkbook, XSSFSheet, XSSFRow, XSSFCell, etc. I do not think that the file's extension should be a problem but you could easily change it from .xls to .xlsx. If you think that you may need to process both BIFF8 and OpenXML (binary and xml) files then you can use the techniques described here; http://poi.apache.org/spreadsheet/converting.html under the heading; 'New, generic SS Usermodel Code' Hopefully, that should solve the problem though you do need to be aware that Microsoft made an earlier attempt with an xml based file format - in Office 2003. If the web site has created a file using this format then POI cannot open it - at least not as far as I am aware. Roberto Santini wrote: > > Hi to all, I0m a new ITALIAN member. > I've a problem reading an XLS file; this file is > automatically generated by an ASPX page. > The error I'm getting is: > > java.io.IOException: Invalid header signature; read > 7813033141555149807, expected -2226271756974174256 > > There is a way to solve or the file is generated with an > error so I can't read it? > If i try to open the same file with Office, it run! > > Bye > Roberto > > ------------------------------------------------------------------- > Roberto Santini > www.lasfidacontinua.it > > MSN: [email protected] > Skype: cent89 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > -- View this message in context: http://www.nabble.com/Error-with-a-XLS-file-tp23757478p23763310.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]
