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: [email protected] For additional commands, e-mail: [email protected]
