I want to know how to make the cell adjust dynamically (the height) I am trying this but it is not dynamically adjusted. The first code is how the titles of the columns are created and the second code is assigned the styles to the titles of the columns
/**
* Creación de los titulos de la columnas.
*
* @param newSheet Parámetro tipo SXSSFSheet
* @param rowObject (Se crea un row, para los N titulos)
* @param byGrid Parámetro tipo Boolean
*/
public void createTitles(SXSSFSheet newSheet, JSONArray rowObject, Boolean byGrid) {
SXSSFRow row = newSheet.createRow(this.currentRowPosition);
this.currentCellPosition = this.initialCellPosition; // Inicializar valor de la posición inicial de la celda.
@SuppressWarnings("unchecked")
List<JSONObject> cellOfRow = rowObject;
for (JSONObject cell : cellOfRow) {
// Crear estructura en base a la información proporcionada por la grilla.
if (byGrid) {
this.createCellForGrid(newSheet, row, cell, "titles");
} else {
this.createCell(newSheet, row, cell, "titles");
}
}
currentRowPosition += 1;
}
/**
* Asignar estilos para los titulos de las columnas del excel.
*/
else if (section.equals("titles")) {
style = this.styleTitle;
value = (cellData.get("header") != null ? cellData.get("header").toString() : "");
this.positionColumnHeader.put(cellData.get("field").toString(), (short) i);
/* style.setWrapText(true);
cell.setCellStyle(style); */
row.setHeightInPoints((5*newSheet.getDefaultRowHeightInPoints()));
//newSheet.autoSizeColumn((short)2);
columnMaxWidth.put((short) i, value.length());
}