Does anyone know if there is any jar by support of which we can write code supporting creation of both formats .xls and .xlsx (APache jar...POI i know)?
Implementation would be a better solution.
Yup, POI is the way to go. If you use the classes in the org.apache.poi.ss.* packages (and NOT the ones in org.apache.poi.hssf or org.apache.poi.xssf) then you can work with both file formats. http://poi.apache.org/spreadsheet/quick-guide.html will get you going (just remember to use the proper package!).
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com