A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
Other Open Source Projects
Problem with setFillBackgroundColor in HSSF
Joined: Dec 19, 2011
Mar 30, 2012 04:01:45
hi friends, i am trying to create a
using POI 3.5.
Every thing is working fine but background color is not reflected in excel.
SSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet =workbook.createSheet("Excel Sheet"); HSSFRow rowhead =sheet.createRow((short) 0); rowhead.createCell((short)0).setCellValue("My Test Report "); HSSFCellStyle cellstyle = workbook.createCellStyle(); cellstyle.setFillBackgroundColor(HSSFColor.GREEN.index); cellstyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); cellstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); HSSFCell cell = rowhead.getCell(0); cell.setCellStyle(cellstyle);
Although alignment works fine. and i found the target color of cell is black not Green.
Any help, Thanks in Advance.
Correct Me if i am wrong
I agree. Here's the link:
subject: Problem with setFillBackgroundColor in HSSF
Help with Dataformats in Excel using Apache POI
facing diffculty to highlight background color of an excel cell which is not reflected in file
Excel Writing Using Java
How to get excel's attribute, using poi ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014