• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

facing diffculty to highlight background color of an excel cell which is not reflected in file

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic