Jump to content

How to make an addition of variables into another variable


atuin

Recommended Posts

I'm sure this is possible, but I can't find a way to do it.

 

I have many variables who came from sub-reports, defined like this :
variable class : integer
calculation : system
reset type : none
increment type : none
 
I want to make a sum for some of these variables, by example : $V{nb1}.plus($V{nb2}).plus($V{nb8}) It works great if I do this into a textfield, but not if I want to put it in a variable (lets call it sum1).
 
property of the variable :
variable class : integer
calculation : system
reset type : report
increment type : none
Like this, I obtain the initial value expression. If I set reset type as none, I obtain null.
 
The textfield containing my variable sum1 is at "evaluation time : report"
 
So, my variable sum1 is calculated before nb1,nb2 and nb8 are. I don't know what to do next...
 
Can somebody help me?
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi, 

You can easily take sum of one variable into another variable like take a varible of name "Sum" with following specifications.

Name: Sum

Variable class: Integer

Calculation : Nothing

Reset Type: Report

Incerement Type : None

Variable Expression : $V{nb1}+($V{nb2}) + $V{nb8}) 

 

I hope that may resolve your problem.

 

 

Link to comment
Share on other sites

... I'm not sure if I don't understand you, or if you tell me to do what I already did : "The textfield containing my variable sum1 is at "evaluation time : report"

Of course I tried every possible evaluation time!

Link to comment
Share on other sites

You are right you have already done it,I could not remember it.Anyhow the solution is working fine as I run it. I would recommend you to check the classes of your variables and make sure that they all are types of integer and also make sure that you have not coming null values in it from the database. Beacuse the above specifiatons should work when the correct data is present.
Link to comment
Share on other sites

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...