This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Java in General and the fly likes How to convert .xls to .xlsx and vice versa using Apache POI api Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to convert .xls to .xlsx and vice versa using Apache POI api" Watch "How to convert .xls to .xlsx and vice versa using Apache POI api" New topic
Author

How to convert .xls to .xlsx and vice versa using Apache POI api

Umesh Kilkile
Greenhorn

Joined: Mar 31, 2010
Posts: 11
My project allows its users to upload / download Excel sheets. But the problem is some users may be using Excel 2007(.xlsx) and some may 2003(.xls). So, what I did is when a client uploads .xls / .xlsx it should be converted to .xls and stored in server. When a client downloads the same should be converted to appropriate format.

I've successfully able to convert .xls to .xlsx and vice versa. But at some stage I'm unable to convert if the Excel file contains too many cellstyles and if the cell is spaned to cover multiple cells.

I hope you will help me to do this task i.e conversion of .xls to .xlsx. and vice versa..

Thank you with Regards
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19908
    
  23

Should I assume you're talking about Apache POI? Or is it perhaps JExcelAPI? TellTheDetails!


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42954
    
  73
I think it'd be a rather laborious process to code a complete converter using POI. Check out the JODConverter library (which uses OpenOffice in server mode).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to convert .xls to .xlsx and vice versa using Apache POI api