Ver Mensaje Individual
  #10 (permalink)  
Antiguo 16/12/2010, 09:06
Avatar de jhonmelguizo
jhonmelguizo
 
Fecha de Ingreso: enero-2008
Ubicación: Medellín - Colombia
Mensajes: 264
Antigüedad: 16 años, 4 meses
Puntos: 6
Respuesta: instalar librería Java Excel API para crear y leer archivos Excel

Hola amigo, estoy utilizando POI, para capturar el valor de la celda debes tener algunas condiciones importantes en el tipo de celda, esto es lo que hago al momento:

Código Java:
Ver original
  1. //if(Arrays.binarySearch(this.Colombia, i) < 0){//Valida las excepciones de columnas
  2.                     switch(hssfCell.getCellType()){
  3.                         case HSSFCell.CELL_TYPE_BLANK: informacionFila.add(""); break;
  4.                         case HSSFCell.CELL_TYPE_BOOLEAN: informacionFila.add(hssfCell.getBooleanCellValue()); break;
  5.                         //case HSSFCell.CELL_TYPE_FORMULA: informacionFila.add(hssfCell.getStringCellValue()) ; break;
  6.                         case HSSFCell.CELL_TYPE_FORMULA: informacionFila.add(""); break;
  7.                         case HSSFCell.CELL_TYPE_NUMERIC:
  8.                             //informacionFila.add(hssfCell.getNumericCellValue());
  9.                             if(DateUtil.isCellDateFormatted(hssfCell)) {
  10.                               //informacionFila.add(hssfCell.getDateCellValue());
  11.                               informacionFila.add(ApiSimex.formatearFecha(hssfCell.toString()));
  12.                             } else {
  13.                               informacionFila.add(hssfCell.getNumericCellValue());
  14.                             }
  15.  
  16.                             break;
  17.                         //case HSSFCell.CELL_TYPE_NUMERIC: informacionFila.add(hssfCell.getDateCellValue()); break;
  18.                         case HSSFCell.CELL_TYPE_STRING: informacionFila.add(hssfCell.getStringCellValue()) ; break;
  19.  
  20.                         default:
  21.                     }
  22.                   //}

Espero sea de ayuda, saludos...