wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes POI: Default Font Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "POI: Default Font" Watch "POI: Default Font" New topic
Author

POI: Default Font

Sunil Manheri
Ranch Hand

Joined: Jul 07, 2004
Posts: 32
Hi,
Is it possible to set the default Font for an Excel sheet using POI?
Thanx,
Sunil.


TechMindViews - Technical Notes
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Sure, you can set default font of Excel sheet using POI .

Example




and use this font in your code.


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Sunil Manheri
Ranch Hand

Joined: Jul 07, 2004
Posts: 32
Hi Somkiat,
Thanx for the reply. Thats right, but I have to use this font in each new cell I am creating. My question is, is it possible to set a font as default so that no need of setting it to each cell, like setting default column width:

[ November 04, 2004: Message edited by: Sunil Manheri ]
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
I think, you cannot do that ...
Mary Wallace
Ranch Hand

Joined: Aug 25, 2003
Posts: 138
HSSFFont tFont = Workbook.createFont();

tFont.setColor(...);
tFont.set...

and the use this font for every cell:
aHSSFCellStyle.setFont(tFont),
[ November 04, 2004: Message edited by: Mary Wallace ]
Sunil Manheri
Ranch Hand

Joined: Jul 07, 2004
Posts: 32
HI Mary,
U repeated the same
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: POI: Default Font