You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Babu kumar Thannasi <ba...@yahoo.com> on 2007/11/09 16:18:55 UTC

POI HSSFTextbox - Can we align a text inside TextBox to center?

Hi , 
             i have some TextBoxes in my Excel which are generated using POI . 
  i trying to align the text inside the Texbox to center .. but i could not find any API to do it. 
  is the any API which alows me to do it.
   
  i am using POI 3.0.1 Jar.
   
  below is my code:
   
  HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
  HSSFClientAnchor txta1 = new HSSFClientAnchor(0,0,250,255,(short)1,0,(short)1,0); 
  HSSFTextbox segPlaTxt = patriarch.createTextbox(txta1);
  segPlaTxt.setLineStyle(HSSFSimpleShape.LINESTYLE_SOLID);
  segPlaTxt.setLineWidth(HSSFSimpleShape.LINEWIDTH_ONE_PT);
  HSSFRichTextString segPlatTxt = new HSSFRichTextString("Text to be align Center");
  segPlatTxt.applyFont(font10);
  segPlaTxt.setString(segPlatTxt);
   
  thanks
  Babu
   

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: POI HSSFTextbox - Can we align a text inside TextBox to center?

Posted by Yegor Kozlov <ye...@dinom.ru>.
Hi,

Looks like text align modifiers are missing. I will see if we can
extend the API.

Yegor

> Hi , 
>              i have some TextBoxes in my Excel which are generated using POI .
>   i trying to align the text inside the Texbox to center .. but i could not find any API to do it.
>   is the any API which alows me to do it.
>    
>   i am using POI 3.0.1 Jar.
>    
>   below is my code:
>    
>   HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
>   HSSFClientAnchor txta1 = new
> HSSFClientAnchor(0,0,250,255,(short)1,0,(short)1,0); 
>   HSSFTextbox segPlaTxt = patriarch.createTextbox(txta1);
>   segPlaTxt.setLineStyle(HSSFSimpleShape.LINESTYLE_SOLID);
>   segPlaTxt.setLineWidth(HSSFSimpleShape.LINEWIDTH_ONE_PT);
>   HSSFRichTextString segPlatTxt = new HSSFRichTextString("Text to be align Center");
>   segPlatTxt.applyFont(font10);
>   segPlaTxt.setString(segPlatTxt);
>    
>   thanks
>   Babu
>    

>  __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 


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