Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

POI: Default Font

 
Sunil Manheri
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is it possible to set the default Font for an Excel sheet using POI?
Thanx,
Sunil.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, you can set default font of Excel sheet using POI .

Example




and use this font in your code.
 
Sunil Manheri
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, you cannot do that ...
 
Mary Wallace
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Mary,
U repeated the same
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic