I have a mainreport containing 2 different subreports.
I have a variable sum from a subreport1 for example 10(type Integer)
I have another variable sum from another subreport2 for example 2(type Integer)
I have successfully retreived the 2 variables from each of the subreports now I want to create a variable in my mainreport that sums up the 2 variables
so now in my mainreport I have 3 variables
the first variable is called VAR1 and it came from subreport 1
Name VAR1
Variable Class java.lang.Integer
Reset type Report
initial Value Expression 0
the second variable is called VAR2 and it came from subreport 2
Name VAR2
Variable Class java.lang.Integer
Reset type Report
initial Value Expression 0
the last variable is called SUM
Name SUM
Variable Class java.lang.Integer
Reset type Report
variable expression new Integer($V{VAR1}.intValue() + $V{VAR2}.intValue() )
initial Value Expression 0
The SUM variable is NULL when i preview the pdf , VAR1 and VAR2 are Integer values but the SUM variable is always NULL
could it be that the SUM was evaluated before VAR1 and VAR2?
what is my problem?