Jump to content
Changes to the Jaspersoft community edition download ×

Ireport how to pass value back from subreport to main report


jeffreychen2016

Recommended Posts

Hi,

I had a hard time passing a value from subreport back to the main report.

I currently have 1 main report and 2 subreports. The relationship is that the main report takes in "salesman" and "dateranges" as parameters to generate a field named "Customer Group". And then pass this field as a parameter to 1st subreport. 1st subreport gets it, and generates a field called "customer name", which will pass on to 2nd subreport as a parameter. Finally, the 2nd report gets all of the information it needs and generates "Sales order number" field and "order amount" field. Everything works perfect till this point. Next, i need to calculate total sales amount for the entire customer group. However, when i added up all of sales amont from each customer, it only returns the sales amount from last customer in a customer group.

Customer Group 1:

        Customer Name 1:

              SO1       SO_AMOUNT1

              SO2       SO_AMOUNT2

        Customer Name 2:

              SO1       SO_AMOUNT1

              SO2       SO_AMOUNT2

 Total for Customer Group 1            (at this point, it only returns value from customer 2 which is summation of SO_AMOUNT1 & 2)

Customer Group 2:

        Customer Name 1:

              SO1       SO_AMOUNT1

              SO2       SO_AMOUNT2

        Customer Name 2:

              SO1       SO_AMOUNT1

              SO2       SO_AMOUNT2

 Total for Customer Group 2            (same happened here, at this point, it only returns value from customer 2 which is summation of SO_AMOUNT1 & 2)

My question is: how can i pass each customer's so amount from subreport 2 to subreport 1. Or if possible, how can i pass an array of so amount from subreport 2 to subreport 1.

Any help will be grealtly appreciated. Thank you in advance!!!!!

 

 

 

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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