How to change the cellType from custom to Text in POI

298 views Asked by At

I am trying to parse an excel file which is having some columns which are in Custom format.I have to convert them into Text before parsing.I am trying to implement a condition that if the celltype is blank and custom it will be converted to text format , I am trying this code but not working

Workbook workbook = excelManager.getWorkbook();     
DataFormat fmt = workbook.createDataFormat();
CellStyle cellStyle = workbook.createCellStyle();
cellStyle.setDataFormat(fmt.getFormat("@"));

But I think this @ will not work for all custom cells. Can anyone please help me? I am using poi 3.16 and version can not be changed.

0

There are 0 answers