posted 13 years ago
iam unable to fill background color for an excel cell
HSSFWorkbook hwb = new HSSFWorkbook();
HSSFSheet sheet = hwb.createSheet("new sheet");
HSSFCellStyle style = hwb.createCellStyle();
HSSFRow row = sheet.createRow((short) 0);
HSSFCell cell = row.createCell((short) 0);
cell.setCellValue(1);
style.setFillBackgroundColor(HSSFColor.RED.index);
style.setFillPattern(HSSFCellStyle.BIG_SPOTS);
cell.setCellStyle(style);
FileOutputStream fileOut = new FileOutputStream("C:\\fillsColor.xls");
hwb.write(fileOut);
fileOut.close();
here is my code please can any one give inputs which correctly reflects background color for a cell of an excel or code do it