poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KiLiCoOl <kilic...@gmail.com>
Subject Re: Setting text as BOLD
Date Wed, 06 Oct 2004 12:42:19 GMT
HSSFCell cell = row.createCell((short)0);
cell.setCellValue("XXX");
HSSFCellStyle cellStyle = wb.createCellStyle();
HSSFFont font = wb.createFont();
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
cellStyle.setFont(font);
cell.setCellStyle(cellStyle);

Best regards,
Julien


On Wed, 6 Oct 2004 05:37:32 -0700 (PDT), Tanmay Sinha
<tanmsinh@yahoo.com> wrote:
> Folks,
> 
> I am new to POI and found it really great. In no time I could write / read to spreadsheets,
but not finding suitable method for seeting text as BOLD.
> 
> Can some one please tell me ?
> 
> Font, alignment etc I was able to do using .....
> createCell(wb, row, (short) i, HSSFCellStyle.ALIGN_CENTER, col_name);
> 
> private static void createCell(HSSFWorkbook wb, HSSFRow row, short column, short align,
String text)
> {
> HSSFCell cell = row.createCell(column);
> cell.setCellValue(text);
> HSSFCellStyle cellStyle = wb.createCellStyle();
> cellStyle.setAlignment(align);
> //cellStyle.setWrapText(true);
> cell.setCellStyle(cellStyle);
> }
> 
> Regards,
> Tan.
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> 


-- 
*´¨ )
¸.•´¸.•´¨)      ¸.•*¨)
(¸.•´ KiLiCoOl (¸.•´
(´¸.•*´¯`*•>

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


Mime
View raw message