Estou tentando aplicar um estilo em um cabeçalho em um arquivo Excel, após ter criado o arquivo e o cabeçalho.
Criei uma classe com o estilo para aplicar nas diversas tabelas que terei no decorrer do programa.
Estou tentando obter o tamanho
-----for (int i = 0; i <= cabecalho.getLastCellNum(); i++) {-----
desta forma utilizando o get ou tambémgetPhysicalNumberOfCells(), mas não esta dando, alguem poderia?
for (int i = 0; i <= cabecalho.getPhysicalNumberOfCells()(); i++) {
CellStyle estilocabecalho = workbookEstilo.createCellStyle();
Font fonte = workbookEstilo.createFont();
fonte.setColor(HSSFFont.BOLDWEIGHT_BOLD);
fonte.setColor(HSSFFont.COLOR_RED);
fonte.setFontName(HSSFFont.FONT_ARIAL);
fonte.setFontHeightInPoints((short) 12);
estilocabecalho.setFont(fonte);
estilocabecalho.setVerticalAlignment(CellStyle.ALIGN_CENTER);
estilocabecalho.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
cabecalho.getCell(i).setCellStyle(estilocabecalho);
}