poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MSB <markbrd...@tiscali.co.uk>
Subject Re: Cloning HSSFCellStyle from XSSFCellStyle
Date Thu, 24 Sep 2009 06:11:03 GMT

I do not think that there is an easy way to accomplish this. In my opinion,
you are looking at writing a method that creates a new style and then copies
the attributes from the 'parent' to this newly created style - rather reads
each of the 'parents' attributes and sets the matching attribute in the
child accordingly; the one obvious problem could be fonts.

If you have not already done so, it might well be worth while looking at how
the cloneStyleFrom() method currently works. You may be able to simply copy
large chunks of the code for re-use. The one aspect of this exercise that
should work in your advantage is the both HSSFCellStyle and XSSFCellStyle
share a common base class.

Yours

Mark B


Lingjiao.Chen wrote:
> 
> Does anyone know if there's a possible way of cloning cell styles between
> HSSF and XSSF formats? I tried the cloneStyleFrom() method, but got an
> exception. 
> 
> If there's an alternative way of doing this, please share.
> 
> Thanks.
> 

-- 
View this message in context: http://www.nabble.com/Cloning-HSSFCellStyle-from-XSSFCellStyle-tp25531169p25531739.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Mime
View raw message