I am assuming that you are interested only in creating binary (.xls) files
and are not targetting the newer xml based ones (.xlsx). If this is the case
then no, there is not a better way I am sorry to say. The reason lies in the
file format itself; briefly, the xls file consists of a series of streams of
data and pointers to various locations in the file, all of it block
structured. It is not possible to determine how the file should be sorted
into blocks nor to calculate the pointers until all of the data for the file
has been accumulated and so, it is not possible to write .xls files out to
memory in smaller chunks.

Yours

Mark B


亮 严 wrote:
> 
> 
> Hi guys,
> From the docs on the poi web site. I know we can use
> org.apache.poi.hssf.usermodel.HSSFWorkbook to create excel 2003 file, like
> HSSFWorkbook workbook = new HSSFWorkbook(); And use
> workbook.write("test.xls") to generate the excel file. If you want to have
> a low memory cost only to read excel file, you can use eventmodel.
> But if i will create a large excel file, it will cost a lot memory to get
> the whole workbook object ready before writing to file using
> workbook.write("***") . What's the best way to use poi to create large
> excel files? I donot think it is the best way to set a large heap of jvm. 
> Need your help. Thanks!
> 
> Your friend
> Yan
>                                         
> _________________________________________________________________
> Windows Live: Friends get your Flickr, Yelp, and Digg updates when they
> e-mail you.
> http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_3:092010
> 

-- 
View this message in context: 
http://old.nabble.com/What%27s-the-best-way-to-use-poi-to-create-large-excel-files--tp27323785p27326176.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to