Hi guys, Thanks for your replies. That is great help for me. Mark B, XSSF spends more memory than HSSF, in creating a same content excel file. If there is a better way to handle writing large file using XSSF, I'd like to have a try. Would you please to tell me how i can do that using XSSF?
Thanks! Yan > Date: Tue, 26 Jan 2010 09:07:34 -0800 > From: [email protected] > To: [email protected] > Subject: Re: What's the best way to use poi to create large excel files? > > > 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 > > > Yan 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 > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > _________________________________________________________________ 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
