Thanks Winston for your reply.
Well, we have been using JExcel API for all the applications we have done so far. And this requirement is for a new application. So, we can decide which one to go with and that shouldn't be a problem.
I checked Apache POI and that didn't help. I found this in their site. [http://poi.apache.org/spreadsheet/limitations.html]
I haven't heard about OpenOffice but I will check that out.
Right now, I don't see many options to choose from to do this pivot table in Java. There is one called SmartXLS (not an open source) and I am checking that out as well..
Thanks