Setting excel style for column as text but on excel creation it shows as General

cell.setCellType(Cell.CELL_TYPE_STRING);
cell.setCellStyle(excelCellStyles.textStyle);

Even after setting the Cell style as Text it is showing Format as General on the Excel

@shreesh3012
You can refer to the following sample code to set the column style to text.
The sample code in Java as follows:

Workbook wb = new Workbook();
Cells cells = wb.getWorksheets().get(0).getCells();

cells.get(0, 0).setValue(1.3);
cells.get(1, 0).setValue(2.5);
Style style = wb.createStyle();
//method 1
//style.setNumber(49);
//method 2
style.setCustom("@");       

StyleFlag flag = new StyleFlag();
flag.setAll(true);
cells.getColumns().get(0).applyStyle(style, flag);
wb.save(filePath + "out_java.xlsx");

If you have any further questions, please provide your sample file and executable test code, and we will check it soon.

can you check this scenario from your end if you set a cell style as Text and then check the cell format on the generated excel-> if it shows as General instead of Text

In my case, due to the cell format being converted to General, if I enter a date in the cell, the cell format is changed from General to Date whereas that shouldn’t be the case, and the type of the cell should remain the same.

@shreesh3012
Please try the sample code and check the D8 cell in the first worksheet of the result file, we can still get the correct result.
The sample code in Java as follows:

Workbook wb = new Workbook();
Cells cells = wb.getWorksheets().get(0).getCells();

cells.get(0, 0).setValue(1.3);
cells.get(1, 0).setValue(2.5);
Style style = wb.createStyle();
//method 1
//style.setNumber(49);
//method 2
style.setCustom("@");       

StyleFlag flag = new StyleFlag();
flag.setAll(true);
cells.getColumns().get(0).applyStyle(style, flag);

Cell cell = cells.get(3, 3);
cell.setValue(9.9);
cell.setStyle(style, flag);

wb.save(filePath + "out_java.xlsx");

Hope helps a bit.

@shreesh3012
Could you share a sample project with template file ? We will check it soon.