wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes How to hanlde .xls and .xlsx using poi api Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "How to hanlde .xls and .xlsx using poi api" Watch "How to hanlde .xls and .xlsx using poi api" New topic
Author

How to hanlde .xls and .xlsx using poi api

rajesh yedula
Greenhorn

Joined: Dec 22, 2011
Posts: 11
Hi All,

I have been using POI 3.2 jar work on reading data from excel sheets.But client wants to support both .xls and .xlsx formats.When i upload .xls it is working fine but when i try to upload .xlsx
i have been getting following error "Invalid header signature 449248204,Expected 23224248977".I heard somewhere to upgrade POI version but i could not able to do bcz i am integrating code in existed implementation.In existed implementation they are using POI 3.2 jar.Is there any ways to resolve this issue without upgrading to POI new versions?Please help me out to resolve this issue.


Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
POI versions below 3.5 do not handle XLS. And even with a recent POI version you'll have to adapt your code to handle both formats.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to hanlde .xls and .xlsx using poi api
 
Similar Threads
Jakarta POI vs Jasper Reports.
error reading excel file using apache poi
How to read xlsx file from local java file
How to read excel2007 file or both .xls and .xlsx files using apache poi
how to convert a .xlsx to .xls file using poi