You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by si...@syntegra.com on 2004/07/15 12:12:51 UTC

Fill problems

Hiya,

I am trying to write out an Excel spreadsheet, and am having problems with
creating filled cells. I was wondering if any of you guys can help me.

I expect the following code to create a thin bordered cell with a light grey
fill.

    headerStyle = wb.createCellStyle();
    headerStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
    headerStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
    headerStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
    headerStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
    headerStyle.setFillBackgroundColor(23);

What actually happens is that the cell is not filled unless I set the
fillPattern with;

	headerStyle.setFillPattern(_SOME_NUMBER);

However I don't want a pattern I want a plain fill. None of the valid pattern
numbers refer to a plain fill - I have enumerated them all and checked, but
if I don't call the setFillPattern() method I don't get a fill.

So, my question is; How do you force a cell to fill with the
fillBackgroundColor and a plain pattern?


Any help would be most appreciated.

Simon Hartley.


********************************************************************

This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person
Thank you

Check us out at http://www.btsyntegra.com

********************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org