The sample code is correct.
setBoldweight was added after 3.5-beta3. Try the latest svn version and all
will be fine.
Daily builds are available at http://encore.torchbox.com/poi-svn-build/
Yegor
Thank you.
This page under ("New, generic SS Usermodel Code")
http://poi.apache.org/spreadsheet/converting.html
and this page under ("User API (HSSF and XSSF)")
http://poi.apache.org/spreadsheet/how-to.html
both show setBoldweight being called on the Font class.
So it's safe to say that the sample code is incorrect?
--- On Thu, 11/20/08, Princess <[EMAIL PROTECTED]> wrote:
From: Princess <[EMAIL PROTECTED]>
Subject: Re: Sample code uses Font.setBoldweight, yet it's not defined in 3.5
beta3
To: "POI Users List" <[email protected]>, [EMAIL PROTECTED]
Date: Thursday, November 20, 2008, 1:08 PM
HSSFCellStyle styleData = wb.createCellStyle();
HSSFFont fontData = wb.createFont();
fontData.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
styleData.setFont(fontData);
On Thu, Nov 20, 2008 at 7:48 PM, Mahesh Ganapathy <[EMAIL PROTECTED]>
wrote:
Its been a while since I worked on the poi but I believe you need to
create
a style object set the weight on it and then apply it to the font. Then
again I could be wrong!
Sent via BlackBerry by AT&T
-----Original Message-----
From: Greg Johnson <[EMAIL PROTECTED]>
Date: Thu, 20 Nov 2008 10:43:01
To: <[email protected]>
Subject: Sample code uses Font.setBoldweight, yet it's not defined in
3.5
beta3
Bottom line, I'm trying the sample code, and it appears that
Font.setBoldweight is missing.
I've downloaded and am referencing the following jar file in my code:
poi-3.5-beta3-20080926.jar
Eclipse automagically selected the following imports for me:
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.Workbook;
I've extracted the following snippet of code from the sample listed
here:
http://poi.apache.org/spreadsheet/converting.html
I'm looking at the section titled:
"New, generic SS Usermodel Code" because that seems to be the
right thing
to do. Am I wrong?
I've reworked a very small snippet of that sample code to these three
lines:
Workbook wb = new HSSFWorkbook();
Font f = wb.createFont();
f.setBoldweight(Font.BOLDWEIGHT_BOLD);
When I try to compile, it tells me that setBoldweight is undefined for
type
Font.
What is going on? Am I mixing the wrong version of sample code with the
jar
file?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]