To copy Formats and Type:

for (int j = 0; j < rowToCopy.getLastCellNum(); j++){
        HSSFCell cellToCopy = rowToCopy.getCell((short)j);
        HSSFCell newCell = newRow.createCell((short)j);
        newCell.setCellStyle(cellToCopy.getCellStyle());
        newCell.setCellType(cellToCopy.getCellType());
}

HTH,
Karsten.

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 5. April 2006 15:53
An: POI Users List
Betreff: RE: FW: I am stuck

cell formulas should be possible. Before copying from the source sheet, 
check if the cellType, if its of type formula, the use the getFormula() 
method, which will return you the formula string. Then paste that value
in 
the target sheets cell. 

I will look something for the formats.. I think it should also be 
possible.. but not sure.

Regards,
Sumit Machwe
Contact: 212-415-5205 (W)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply via email to