thx, it works now, the funktion i use for setting the style ist:

public void createExcelCaption(HSSFCellStyle cellStyle, HSSFRow row, String
title, short column) {
        HSSFCell cell = row.createCell(column);
        cell.setCellValue(title);
        cell.setCellStyle(cellStyle);           
}

-----Ursprüngliche Nachricht-----
Von: Tom Schindl [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 28. März 2006 14:27
An: POI Users List
Betreff: Re: AW: Excel - Backgroundcolor


Beyer, Daniel (SL1 D) wrote:
> thx, but i wrote the following and it doesn´t seem to work:
>                       
> HSSFCellStyle captionStyle = workBook.createCellStyle();
> captionStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);

The next line is not needed

> captionStyle.setFillBackgroundColor(HSSFColor.RED.index);

This should be:
captionStyle.setFillForegroundColor(HSSFColor.RED.index);
> captionStyle.setFillForegroundColor(HSSFColor.BLACK.index); 
> captionStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
> HSSFRow row = sheet.createRow((short) 0);
>               

Where do you assing the style to the cell?

> createExcelCaption(captionStyle, row, "DATUM", (short) 0);
> createExcelCaption(captionStyle, row, "PERFORMANCE", (short) 1);
> createExcelCaption(captionStyle, row, "VARIANTE", (short) 2);
> 
> Daniel
> 

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply via email to