HSSFFont.BOLDWEIGHT_BOLD - compile error NPOI 1.2.5.0

Jun 13, 2012 at 3:04 PM

Hello,

We are trying to bold a row in excel , Visual studio 2008,

framework 3.5 NPOI 1.2.5.0 - getting compile error

Following is the code snippet,

ICellStyle style1 = templateWorkbook.CreateCellStyle();
style1.SetFont(font1);
HSSFWorkbook hssfworkbook = new HSSFWorkbook();
HSSFFont font = (HSSFFont)hssfworkbook.CreateFont();
font.Boldweight = HSSFFont.BOLDWEIGHT_BOLD;
style1.SetFont(font1);


it is giving compile error on line where we have written
font.Boldweight = HSSFFont.BOLDWEIGHT_BOLD;

compile Error    2    'NPOI.HSSF.UserModel.HSSFFont'

does not contain a definition for 'BOLDWEIGHT_BOLD'   

C:\SampleApp\XLSFormatDotNet\XLSFormatingDLL\Class1.cs   

301    60    XLSFormatingDLL

Sample codes on the internet show same syntax, but I am getting this compiler error, seems strange,

please help me.

 

Regards

sham yemul, www.Intellisoft.co.in

Aug 24, 2012 at 7:12 PM

See my reply to a similar question here: http://npoi.codeplex.com/discussions/368678