poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Black <pelican5...@hotmail.com>
Subject RE: Can POI(Excel) change cell font color partially
Date Fri, 01 Oct 2010 06:01:04 GMT

Yes. You are right. It can be done with RichTextString

CreationHelper ch = wb.getCreationHelper();
...
RichTextString rts = ch.createRichTextString("abcdefghij");
Font f1 = wb.createFont();
f1.setColor(......RED...)
Font f2 = wb.createFont();
f2.setColor(.....
rts.applyFont(0, 5, f1);
rts.applyFont(6, 8, f2);

...

rgds,



> To: user@poi.apache.org
> Subject: Re: Can POI(Excel) change cell font color partially
> From: Louis.Masters@log-net.com
> Date: Tue, 28 Sep 2010 09:53:11 -0400
> 
> Did you try using a "RichTextString" ?  I have never used it, but from the 
> help file it looks like it might do what you need.
> -Lou
> 
> 
> 
> floydF floydL <floyddcn@gmail.com> wrote on 09/28/2010 09:45:00 AM:
> 
> > A cell whose text is 'hello world' in black color can be modified to
> > 'hello'-red & 'world'-blue ? A cell with two colors... -- the office 
> excel
> > can easily do this(event the excel2002)
> > 
> > i check the POI example,found the following code
> > 'f.setColor( IndexedColors.RED.getIndex() ); ' which cannot fill my 
> needs.
> > Any suggestion is appreciated.
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message