poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yan Liang <yliang_2...@hotmail.com>
Subject Re: What's the best way to use poi to create large excel files?
Date Thu, 28 Jan 2010 10:46:53 GMT
Thank you Mark B.
I will have a try.

Yan

On 2010年01月27日 15:35, MSB wrote:
> Yegor wrote a proof of concept called BigGridDemo
> (http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java)
> that, as far as I understand it, streams the data into a temporary file and
> then 'merges' that data into a worksheet. I do not know how far this
> technique has been developed yet but there are other list members who have
> used the technique to create large worksheet files successfully. It does
> however work only for the newer xml based file format introduced in
> Office2007.
>
> Yours
>
> Mark B
>
>
> 亮 严 wrote:
>    
>>
>> 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: markbrdsly@tiscali.co.uk
>>> To: user@poi.apache.org
>>> 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: user-unsubscribe@poi.apache.org
>>> For additional commands, e-mail: user-help@poi.apache.org
>>>
>>>        
>>   		 	   		
>> _________________________________________________________________
>> 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
>>
>>      
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message