title: How to get return value from sub report to main report?
body: <p>I am using <em>JasperReports</em> 4.5.1 version i am facing problem with sum of value,  i have two report one is main report and another is sub-report main report has 3 row and sub report have 5 row and 3 column  i want to do the last column's sum and pass to the main report. so i am create one variable and store the  sum of column no 3 and return it to main report but every time i am getting first total is null or 0 and i am not getting last table's total  like this </p>
  
  <pre><code> This is my main report
  -----------------------------------------------------
      no     Item               price        discount%
  -----------------------------------------------------
   This is my Sub-Report
      1         A                 150              10
      2         B                 200              10
      3         C                 550              25
   ---------------------------------------------------
   This is also my Main report
     Total                       Sum(Prise)
  
  -----------------------------------------------------
      no     Item               price        discount%
  -----------------------------------------------------
      1         A                 1150              10
      2         B                 2500              5
   ---------------------------------------------------
     Total                       Sum(Prise)  
  
  -----------------------------------------------------
      no     Item               price        discount%
  -----------------------------------------------------
      1         A                 50000              10
      2         B                 20500              5
   ---------------------------------------------------
     Total                       Sum(Prise)  
  </code></pre>
  
  <p>i am getting the out put is Sum1= null,  sum2==(150+200+550) and sum3 =(1150+2500) and i am getting the third tables sum.</p>
  
  <p>how can i solve it please help me .</p>