Error while compiling

0

Hi,

 

I have a report where I want to use java class to convert amount to workds. I converted the Java Class file to a JAR file and added that JAR file (ADD JAR) via iReport.

Now, when I tried to run that report I see the error window pops up and show this:

Please guide me how to fix this.

Thank you
Regards
=================================================

Error Message

Errors were encountered when compiling report expressions class file: 1. com.HashmiTech.NumberToWords cannot be resolved to a type value = com.HashmiTech.NumberToWords.convert( ((java.lang.Double)field_grand_total.getValue()) ); //$JR_EXPR_ID=9$ <------------------------> 2. com.HashmiTech.NumberToWords cannot be resolved to a type value = com.HashmiTech.NumberToWords.convert( ((java.lang.Double)field_grand_total.getValue()) ); //$JR_EXPR_ID=10$ <------------------------> 3. com.HashmiTech.NumberToWords cannot be resolved to a type value = com.HashmiTech.NumberToWords.convert( ((java.lang.Double)field_grand_total.getOldValue()) ); //$JR_EXPR_ID=9$ <------------------------> 4. com.HashmiTech.NumberToWords cannot be resolved to a type value = com.HashmiTech.NumberToWords.convert( ((java.lang.Double)field_grand_total.getOldValue()) ); //$JR_EXPR_ID=10$ <------------------------> 5. com.HashmiTech.NumberToWords cannot be resolved to a type value = com.HashmiTech.NumberToWords.convert( ((java.lang.Double)field_grand_total.getValue()) ); //$JR_EXPR_ID=9$ <------------------------> 6. com.HashmiTech.NumberToWords cannot be resolved to a type value = com.HashmiTech.NumberToWords.convert( ((java.lang.Double)field_grand_total.getValue()) ); //$JR_EXPR_ID=10$ <------------------------> 6 errors

=================================================


 

zeeshanhashmi's picture
Joined: Mar 31 2014 - 6:53am
Last seen: 2 years 5 months ago

<![CDATA[com.HashmiTech.NumberToWords.convert($F{grand_total})]]>

This is how I am calling this. It gets numbers for example, 34890.90 and then it converts it to "Thirty four thousand eight hundred and ninty Dollars and Ninty cents."

 

zeeshanhashmi - 5 years 7 months ago

Is there anyone who can help ? Seems to be a dead forum.

zeeshanhashmi - 5 years 7 months ago

2 Answers:

0

Seems like you have a data type problem. What datatype does com.HashmiTech.NumberToWords return? What's the expression where it's uses? Are you using Scriptlets? Try using a variable in your field or parameter expression and calling calling your java class in your variable, but before you do, try setting a value in your variable to make sure your expressions works.

hozawa's picture
52362
Joined: Apr 24 2010 - 4:31pm
Last seen: 5 months 6 days ago

<![CDATA[com.HashmiTech.NumberToWords.convert($F{grand_total})]]>

This is how I am calling this. It gets numbers for example, 34890.90 and then it converts it to "Thirty four thousand eight hundred and ninty Dollars and Ninty cents."

zeeshanhashmi - 5 years 7 months ago

did you get this working?

narottamgupta51 - 5 years 4 months ago
0

I was able to solve the issue by migrating to Jaspersoft Studio version 5.6.0.final. Jaspersoft Studio is the official report designer anyway.

narottamgupta51's picture
Joined: Apr 3 2014 - 5:38am
Last seen: 5 years 3 months ago
Feedback