Just had a small question. I am actually reading an excel file on the server using POI. Do I need excel to be installed on that server?
Thanks, ANuj -----Original Message----- From: Andrej Golovnin [mailto:[EMAIL PROTECTED] Sent: Thursday, April 24, 2003 7:27 AM To: POI Users List Subject: Re: copy Cell Style Hi mike, Your method seems to be Ok. I'm using a similar method to copy a cell with style and value but only in the same sheet and every thing works fine. Here is my method, hope this will help: /** Copies the specified cell to a new location in the specified sheet. * It will copies both the value and format of the cell. * @param sheet the sheet to be used for copying. * @param cell the cell to be copied. * @param dstRow the row where the cell is placed. * @param dstColumn the column where the cell is placed. */ private void copyCell(final HSSFSheet sheet, final HSSFCell cell, final int dstRow, final int dstColumn) { HSSFRow row = sheet.getRow(dstRow); if ( row == null ) { row = sheet.createRow((short)dstRow); } HSSFCell dstCell = row.getCell((short)dstColumn); if ( dstCell == null ) { dstCell = row.createCell((short)dstColumn); } dstCell.setCellStyle(cell.getCellStyle()); switch( cell.getCellType() ) { case HSSFCell.CELL_TYPE_BOOLEAN: dstCell.setCellValue(cell.getBooleanCellValue()); break; case HSSFCell.CELL_TYPE_ERROR: dstCell.setCellErrorValue(cell.getErrorCellValue()); break; case HSSFCell.CELL_TYPE_NUMERIC: dstCell.setCellValue(cell.getNumericCellValue()); break; case HSSFCell.CELL_TYPE_STRING: dstCell.setCellValue(cell.getStringCellValue()); break; } dstCell.setEncoding(cell.getEncoding()); } Regards, Andrej Golovnin -- +++ GMX - Mail, Messaging & more http://www.gmx.net +++ Bitte l�cheln! Fotogalerie online mit GMX ohne eigene Homepage! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
