Hi, I am trying to change font color to Black
Here is the Code :
Workbook workbook = new Workbook();
FileInputStream fstream = new FileInputStream(“C:\abc.xls”);
workbook.open(fstream, FileFormatType.EXCEL97TO2003);
Worksheet worksheet = workbook.getWorksheets().getSheet(1);
Cells cells = worksheet.getCells();
int num=cells.getMaxDataRow();
int num1=cells.getMaxDataColumn();
System.out.println(cells.getMaxDataColumn());
System.out.println(cells.getMaxDataRow());
for(int n1=0;n1<num;n1++)
{ for(int Colno=0;Colno<=num1;Colno++)
{
if (cells.getCell(n1,Colno).getValue()!=null)
{ Cell cell12=cells.getCell(n1,Colno);
System.out.println(cell12.getStyle().toString());
Style style = cell12.getStyle();
Font font = style.getFont();
font.setBold(true);
cell12.setStyle(style);
font.setColor(Color.BLACK);
font.setBold(true);
}
}
}
Attached Sample file for your reference.