Set the foreground color when you set the solid fill pattern. Its filling SOLIDLY with the FOREGROUND color. Just like the other patterns fill with dots for instance...they fill dots of the FOREGROUND color.
-Andy On Thu, 2002-04-18 at 05:15, StorFalingen . wrote: > Hi, time for another RTFM question! > > It seems that I have asked this question before... > I downloaded the new binaries and tried some different suff and everything > seems fine to me. But I still cant set a solid backround color, and the > solid foreground color always results in a black foreground no matter what > color I choose. > > //Always black > xlsDoc = new HSSFWorkbook(); > HSSFCellStyle redStyle = xlsDoc.createCellStyle(); > redStyle.setFillBackgroundColor(HSSFCellStyle.RED); > redStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); > > //No color > xlsDoc = new HSSFWorkbook(); > HSSFCellStyle redStyle = xlsDoc.createCellStyle(); > redStyle.setFillBackgroundColor(HSSFCellStyle.RED); > redStyle.setFillPattern(HSSFCellStyle.AUTOMATIC); > > //Color OK but the data is hard to read thorugh the pattern > xlsDoc = new HSSFWorkbook(); > HSSFCellStyle redStyle = xlsDoc.createCellStyle(); > redStyle.setFillBackgroundColor(HSSFCellStyle.RED); > redStyle.setFillPattern(HSSFCellStyle.SPARSE_DOTS); > > > / marcus > > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > -- http://www.superlinksoftware.com http://jakarta.apache.org/poi - port of Excel/Word/OLE 2 Compound Document format to java http://developer.java.sun.com/developer/bugParade/bugs/4487555.html - fix java generics! The avalanche has already started. It is too late for the pebbles to vote. -Ambassador Kosh
