1

I am using apache poi 3.9. I need to have a custom color in my excel. On the apache documentation and some other suggestions there is a code:

Workbook wb = new HSSFWorkbook();
HSSFPalette palette = wb.getCustomPalette();

but Workbook does not have method getCustomPalette(). Please help me to find out how can I have a custom color on the cells

Thanks

pms
  • 944
  • 12
  • 28
  • 1
    Yes it does: http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html#getCustomPalette(). If that doesn't work you'll have to give more details. – Pedantic Nov 26 '13 at 20:48
  • I get compile error because there is no such method in the HSSFWorkBook. – pms Nov 26 '13 at 20:53
  • I have poi-ooxml and poi dependencies in my pom.xml do I need to add another library? – pms Nov 26 '13 at 20:54
  • 1
    poi-ooxml dependency is enough but the check the version which you are using. – swamy Nov 27 '13 at 11:37

1 Answers1

3

Ok. I found it. should be:

HSSFWorkbook wb = new HSSFWorkbook();

instead of:

Workbook wb = new HSSFWorkbook();

pms
  • 944
  • 12
  • 28