please check the link
http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java
there are some reasons to avoid poi.
1. for jdk 1.4 poi supports only xls.
2. poi does not support to generate pivot table.
3.some servers take more memory to generate sheets
steps:
1) create Excel template file (without the data-rows) with aspose api, save to disk
2) open ZipFile, iterate over all file-entries
3) open new ZipOutputStream(servletRequest.getOutputStream())
4) copy all ZipEntries to ZipOutputStream except:
5) when the ZipEntry is for 'xl/worksheets/sheet1.xml', then create new XMLStreamWriter(zipOutputStream)
5a) Write Excel sheet header to XML stream
5b) for each row in the csv, populate XML row (using poi cellReference() class)
5c) write Excel sheet footer to XML stream
6) close xml stream, continue with copying the other ZIP entries
after read the excel file using asposeAPI
and create pivot table for sheet1.
by using this approach we can genarate xlsx file havaing 30,00,000 rows and 140 cols in less than 25 mins.
Thanks & Regards.
Ranjith.