On Thu, 23 Apr 2009, alamu wrote:
Requirement: Copy the sheet from one workbook to another workbook. (which
includes copying format etc).

//code to fetch workbooks, sheets, rows, cells
HSSFCell oldCell, HSSFCell newCell;
newCell.setCellStyle(oldCell.getCellStyle());

This won't work, and never has. A recent change was to flag up that what you've tried to is invalid. Please see the javadocs. What you'll actually want is HSSFCellStyle.cloneStyleFrom:
http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFCellStyle.html#cloneStyleFrom(org.apache.poi.hssf.usermodel.HSSFCellStyle)

Nick

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

Reply via email to