poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto G. Fernández <rgfer...@gmail.com>
Subject Re: HSSFCellStyle problems... border style... background color...
Date Wed, 16 Jul 2008 17:29:54 GMT

You sould replace the line

    hssf_cell_style_header.setFillBackgroundColor(new
HSSFColor.GREY_25_PERCENT().getIndex());

The line you should use is:

   hssf_cell_style_header.setFillForegroundColor(new
HSSFColor.GREY_25_PERCENT().getIndex());


cga wrote:
> 
> I develope a Java aplication, and try to export some data in MS Excel
> format using POI...
> 
> I set HSSFCellStyle borders styles... generate the MS Excel but when I try
> to open Format Cell dlg (in MS Excell offcourse) that doesn't open... if I
> don't set border style, no problemo
> 
> Another problem... is I set on HSSFCellStyle fill pattern to
> SOLID_FOREGROUND (for solid color on background cell), cell become black,
> even the color is red or green or wherever you want... for any other fill
> patern works fine...
> 
> Here is the code:
> 
> hssf_cell_style_header = hssf_workbook.createCellStyle();
> hssf_cell_style_header.setFont(hssf_font_bold);
> hssf_cell_style_header.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
> hssf_cell_style_header.setFillBackgroundColor(new
> HSSFColor.GREY_25_PERCENT().getIndex());
> hssf_cell_style_header.setBorderTop(HSSFCellStyle.BORDER_THIN);
> hssf_cell_style_header.setBorderLeft(HSSFCellStyle.BORDER_THIN);
> hssf_cell_style_header.setBorderBottom(HSSFCellStyle.BORDER_THIN);
> hssf_cell_style_header.setBorderRight(HSSFCellStyle.BORDER_THIN);
> 
> Version POI: how can I know the version?
> 
> this is? (I found somewhere in hpsf package)
> author Rainer Klute (klute@rainer-klute.de)
> @version $Id: package.html,v 1.3 2002/03/10 17:03:41 acoliver Exp $
> @since 2002-02-09
> 
> 

-- 
View this message in context: http://www.nabble.com/HSSFCellStyle-problems...-border-style...-background-color...-tp9590896p18492573.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Mime
View raw message