You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by kfcSmitty <kf...@hotmail.com> on 2008/03/24 17:38:23 UTC

HSSFFormulaEvaluator

My code is as follows: 

row = sheet.createRow((short) 81);
			
cell = row.createCell((short) 2);
HSSFFormulaEvaluator evaluator = new HSSFFormulaEvaluator(sheet, wb);
evaluator.setCurrentRow(row); 
cell.setCellFormula("COUNTIF(D81:Z81,\"<65\")");
String formula = cell.getCellFormula();
if (cell != null && cell.getCellType() == HSSFCell.CELL_TYPE_FORMULA){ 
	if (formula != null)
		evaluator.evaluateInCell (cell); 
}//end if

And I am getting the following error:

java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFCell: method
getRichStringCellValue()Lorg/apache/poi/hssf/usermodel/HSSFRichTextString;
not found
	at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.getEvalForCell(HSSFFormulaEvaluator.java:554)
	at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.internalEvaluate(HSSFFormulaEvaluator.java:426)
	at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateInCell(HSSFFormulaEvaluator.java:286)

Has anyone encountered this? Also, could someone point me in the right
direction to simply allowing the COUNTIF function to work properly from POI
to excel?

Thanks,

Smitty
-- 
View this message in context: http://www.nabble.com/HSSFFormulaEvaluator-tp16255683p16255683.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Re: HSSFFormulaEvaluator

Posted by Nick Burch <ni...@torchbox.com>.
On Mon, 24 Mar 2008, kfcSmitty wrote:
> I am using POI 3.0.2 Final in Eclipse, so they're not mix matched. I do 
> have other POI jar's in a directory in my classpath, but I have been 
> unable to delete them to date. Could those be causing the issue?

Almost certainly. As with almost all software, you'll want to only have 
the one version of poi on your classpath. If you have bits of different 
versions, thing will get very screwy

> As for the SVN, could you link me? I used one [i]once[/i] before, but I 
> admit I am unfamiliar with the technology.

You can download nightlies from
 	http://encore.torchbox.com/poi-svn-build/

> Would the nightly build basically put me in an alpha or beta phase while 
> using POI? The programs I am developing will be used in a production 
> environment so I would rather stick with the Final versions if that is 
> the case.

Yes, it'd put you on the bleeding edge. You'll need to decide if you'd 
rather have the new support, currently in svn, or the -FINAL version tag, 
which doesn't have all the support Josh has added recently

I think Yegor is planning on calling another 3.0.x release not too long 
after apachecon, so you could always start developing against a svn 
version, and switch to the new -final once released. Personally, I'm using 
svn versions of poi in production

Nick

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


Re: HSSFFormulaEvaluator

Posted by kfcSmitty <kf...@hotmail.com>.
Thanks for your reply Nick.

I am using POI 3.0.2 Final in Eclipse, so they're not mix matched. I do have
other POI jar's in a directory in my classpath, but I have been unable to
delete them to date. Could those be causing the issue?

As for the SVN, could you link me? I used one [i]once[/i] before, but I
admit I am unfamiliar with the technology. Would the nightly build basically
put me in an alpha or beta phase while using POI? The programs I am
developing will be used in a production environment so I would rather stick
with the Final versions if that is the case.



Nick Burch wrote:
> 
> On Mon, 24 Mar 2008, kfcSmitty wrote:
>> And I am getting the following error:
>>
>> java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFCell:
>> method
>> getRichStringCellValue()Lorg/apache/poi/hssf/usermodel/HSSFRichTextString;
> 
> You almost certainly have mis-matched poi jars. Ensure that you are using
> the same version of the main poi jar, and of the poi scratchpad jar
> 
>> Also, could someone point me in the right direction to simply allowing
>> the COUNTIF function to work properly from POI to excel?
> 
> Have you tried from a svn checkout / nightly build? There have been quite
> a few improvements to the formula parser since 3.0.2 was released
> 
> Nick
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/HSSFFormulaEvaluator-tp16255683p16258313.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Re: HSSFFormulaEvaluator

Posted by Nick Burch <ni...@torchbox.com>.
On Mon, 24 Mar 2008, kfcSmitty wrote:
> And I am getting the following error:
>
> java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFCell: method
> getRichStringCellValue()Lorg/apache/poi/hssf/usermodel/HSSFRichTextString;

You almost certainly have mis-matched poi jars. Ensure that you are using
the same version of the main poi jar, and of the poi scratchpad jar

> Also, could someone point me in the right direction to simply allowing
> the COUNTIF function to work properly from POI to excel?

Have you tried from a svn checkout / nightly build? There have been quite
a few improvements to the formula parser since 3.0.2 was released

Nick

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