convertir un tipo de celda numérica en un tipo de celda de texto en ms excel document sin cambiar el contenido de la celda usando open office

StackOverflow https://stackoverflow.com/questions/1824104

  •  22-07-2019
  •  | 
  •  

Pregunta

Cómo convertir un tipo de celda numérica en un tipo de celda de texto en un documento de Excel sin cambiar el contenido de la celda usando la oficina abierta. Luego se accede a este valor de celda utilizando java (POI JAR getRichStringCellValue () método de HSSFCELL Object).

¿Fue útil?

Solución

Prueba esto:

HSSFWorkbook wb = ...;
DataFormat format = wb.createDataFormat();

HSSFCellStyle cellStyle = wb.createCellStyle();
style.setDataFormat(format.getFormat("@")); // or "text"
cell.setCellStyle(cellStyle);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top