Jump to content
Changes to the Jaspersoft community edition download ×

Help Please!!! Adding two Double values....


chiragkini

Recommended Posts

Hi Guys!

I am new to Jaspers IReport . I use this in netbeans 6.5 for reporting but I am facing one problem------>>>

I have two fields whose Expression class java.lang.Double, whose values are taken from database.

Now I want to add those two fields and display in Third Field, But whenever I use + operator to add those two fields in third field expression it gives me error " The operator +  is undefined for the argument type(s) java.lang.Double,  java.lang.Double"

I dont know why its not allowing to add two Double fields.. 

So please guys help me out with this problem....

Thanks in Advance...

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Thanks Oxelad,

But when I tried to do this it gives me error saying "Cannot cast from double to Double"

 

so even if when i tried to convert values first into string the convert into double it fails.

For eg. when i do ($f{variable1}.toString()).doubleValue() +($f{variable2}.toString()).doubleValue() , it gives me error: "The method doubleValue() is undefined for type String....

 

Note: my variable values comes from database tables of type DOUBLE.

 

Hope u got it what is scenario...

 

 

Link to comment
Share on other sites

  • 2 years later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...