poi-3.0-alpha3-20070130.jar
I downloaded the latest jar, replaced the old one and restarted all related
services. I still get the error.
Inside this file, I could locate: \org\apache\poi\hssf\usermodel\
HSSFComment.class
I'll just copy the example:
// Create the drawing patriarch. This is the top level container for all
shapes including cell comments.
HSSFPatriarch patr = sheet.createDrawingPatriarch();
//create a cell in row 3 and set some text value
...
...
//anchor defines size and position of the comment in worksheet
HSSFComment comment1 = patr.createComment(new HSSFClientAnchor(0, 0, 0, 0,
(short)4, 2, (short) 6, 5));
Here, I get the error. When I try to use createComment method for patr. Maybe,
I must try some other way to set the Anchor? The anchor has the method to
create the comment doesn't it? I think after I can call the method, I will
be able to use setString and setCellComment?
In Coldfusion, it is impossible to use it like patr.createComment(new
HSSFClientAnchor(0,...) you must tell the contents to coldfusion that it is
java content or variable type. Let me give some examples:
workBook = createObject("java","org.apache.poi.hssf.usermodel.HSSFWorkbook
").init();
...
whiteFont = workBook.createFont();
whiteFont.setFontHeightInPoints(8);
whiteFont.setFontName("Arial Narrow");
whiteFont.setColor(createObject("java","
org.apache.poi.hssf.util.HSSFColor$WHITE").getIndex());
...
aquaStyle.setFillPattern(aquaStyle.SOLID_FOREGROUND);
aquaStyle.setFont(whiteFont);
aquaStyle.setFillForegroundColor(createObject("java","
org.apache.poi.hssf.util.HSSFColor$AQUA").getIndex());
...
...
dateStyle.setDataFormat(createObject("java","
org.apache.poi.hssf.usermodel.HSSFDataFormat").getBuiltinFormat("m/d/yy"));
...
...
newSheet = workBook.createSheet();
workBook.setSheetName( #sheetNo#, "#sheetName#",
workBook.ENCODING_UTF_16);
...
...
cell.setCellFormula(javacast("string",#formula#));
Thanks,
Cenk
2007/1/30, Yegor Kozlov <[EMAIL PROTECTED]>:
Browse the POI classes. Do you see the methods you are calling?
If not, you are using the old jar or Coldfusion is using the "cached"
old stuff. And what is
createObject("java","org.apache.poi.hssf.usermodel.HSSFClientAnchor")?
It's the only difference from the quick guide's example and I suspect
something is wrong with it.