File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Head First Android this week in the Android 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: 20049
    
  30

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


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

Joined: Mar 22, 2005
Posts: 42956
    
  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
 
It's not a secret anymore!