poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Andrews <pythonadd...@yahoo.com>
Subject Re: AW: 2 Fonts in 1 Cell - ByteArrayInputStream
Date Tue, 06 Dec 2005 08:18:05 GMT
How about this for an odd ides then!!

I also use JExcelAPI to generate worksheets - I began
using it at the time POI did not handle images - and
belong to a similar list set up for users of that API.
One of the members of the list has a favourite trick
he uses if the API does not provide the functionality
he requires. Quite simply, he records a key stroke
macro and sets it to be activated when the worksheet
is opened. Would it not be possible to use a similar
technique here? The macro could simply set the fonts
on the String after it had been written to the cell.

--- Tobias Meyer <tm@allocation.net> wrote:

> Oops, my bad - I should have actually tried before
> claiming it doesn't
> work...
> 
> POI however seems to loose this information when
> processing an excel file.
> (i.e. read .xls file, write back to disk).
> The Unicode approach to the original problem
> nontheless works (at least for
> me and my fonts-configuration).
> 
> Tobias
> 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Anthony Andrews
> [mailto:pythonaddict@yahoo.com]
> > Gesendet: Samstag, 3. Dezember 2005 12:17
> > An: POI Users List; Christian Gosch
> > Betreff: Re: 2 Fonts in 1 Cell -
> ByteArrayInputStream
> > 
> > 
> > Hello Christian
> > 
> > Must admit I did not quite believe it myself but
> you
> > can indeed set two - or more - fonts on a single
> > string in one cell. But I think that you face one
> huge
> > problem.
> > 
> > I could be wrong but I think that HSSF uses the
> > Excel97 format as standard and as you indicate
> below,
> > it may only be possible to use two fonts in one
> cell
> > in Excel versions 2000 on.
> > 
> > --- Christian Gosch <c.gosch@inovex.de> wrote:
> > 
> > > Actually it does, depending on the version
> (should
> > > be Excel2000 or newer).
> > > Look on the attachment "multifontexample.xls",
> if it
> > > is still there.
> > > 
> > > Regards
> > > Christian Gosch
> > > inovex GmbH
> > > 
> > > 
> > > On Friday, December 02, 2005 10:45 AM
> [GMT+1=CET],
> > > Tobias Meyer <tm@allocation.net> wrote:
> > > 
> > > > AFAIK Excel does not support two fonts in one
> > > cell. Try doing thin in
> > > > excel itself...
> > > >
> > > > As "workaround" (maybe it's cleaner
> anyways...)
> > > try settung your
> > > > Cell's encoding to UTF-16 and use the Unicode
> > > character \u2211 (Sum)
> > > > or maybe the Greek Sigma \u03A3, if the Sum
> Symbol
> > > is not in your
> > > > Font.
> > > >
> > > > i.e.:
> > > >
> > > >  HSSFCell cell = row.createCell(x);
> > > >  cell.setEncoding(HSSFCell.ENCODING_UTF_16);
> > > >  cell.setCellValue("\u2211 "+yourStringHere);
> //
> > > Sum sign + your text
> > > >
> > > > See:
> > > >
> > > > http://www.unicode.org/charts/ for a
> definition of
> > > the unicode
> > > > characters, and
> > > > http://www.unicode.org/charts/PDF/U2200.pdf
> for a
> > > whole bunch of
> > > > mathematical symbols.
> > > >
> > > > A Pitfall with this attempt may be that not
> all
> > > fonts support all
> > > > characters - but it is well worth a try...
> > > >
> > > > For a general introduction to Unicode I
> recommend:
> > > >
> > >
> http://www.joelonsoftware.com/articles/Unicode.html
> > > > (Do you know the difference between Unicode,
> UTF-8
> > > and UTF-16 ? ;-)
> > > >
> > > > Hth,
> > > > Tobias
> > > >
> > > >
> > > >> -----Ursprüngliche Nachricht-----
> > > >> Von: smashy [mailto:smashy@programmer.net]
> > > >> Gesendet: Dienstag, 29. November 2005 09:34
> > > >> An: poi-user@jakarta.apache.org
> > > >> Betreff: 2 Fonts in 1 Cell -
> ByteArrayInputStream
> > > >>
> > > >>
> > > >> Hi,
> > > >>
> > > >> is it possible to use 2 different Font typs
> > > (Arial , Symbol)
> > > >> in one Excel cell?
> > > >> I use a ByteArrayInputStream from Oracle DB
> to
> > > create a HSSF
> > > >> workbook. This
> > > >> stream contained the whole workbook with
> cells
> > > which switch
> > > >> the Fonts. After
> > > >> creating the HSSFWorkbook my cells shwoing
> only
> > > one Font.
> > > >> Why? Waht can i do if
> > > >> i need tow font per cell? I need the "Summ"
> > > Symbol from the
> > > >> Symbol FontSet.
> > > >>
> > > >> THX!
> > > >>
> > > >> IKT - http://kickme.to/smashy
> > > >>
> > > >>
> > > >>
> > >
> >
>
---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail:
> > > poi-user-unsubscribe@jakarta.apache.org
> > > >> Mailing List:    
> > > http://jakarta.apache.org/site/mail2.html#poi
> > > >> The Apache Jakarta Poi Project: 
> > > http://jakarta.apache.org/poi/
> > > >>
> > > >
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > poi-user-unsubscribe@jakarta.apache.org
> > > > Mailing List:    
> > > http://jakarta.apache.org/site/mail2.html#poi
> > > > The Apache Jakarta Poi Project: 
> > > http://jakarta.apache.org/poi/
> > > 
> > > Gruesse,
> > > -- 
> > > Dipl.-Inform. Christian Gosch
> > > Systems Development
> > > inovex GmbH
> > > Karlsruher Strasse 71
> > > D-75179 Pforzheim
> > > Tel.: +49 (0)72 31 - 31 91 - 85
> > > Fax: +49 (0)72 31 - 31 91 - 91
> > > mailto:c.gosch@inovex.de
> > > http://www.inovex.de
> > > 
> > > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > poi-user-unsubscribe@jakarta.apache.org
> > > Mailing List:    
> > > http://jakarta.apache.org/site/mail2.html#poi
> > > The Apache Jakarta Poi Project: 
> > http://jakarta.apache.org/poi/
> > 
> > 
> > 
> > 		
> > __________________________________ 
> > Start your day with Yahoo! - Make it your home
> page! 
> > http://www.yahoo.com/r/hs
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> poi-user-unsubscribe@jakarta.apache.org
> > Mailing List:    
> http://jakarta.apache.org/site/mail2.html#poi
> 
=== message truncated ===



		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 


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


Mime
View raw message