Jump to content
Changes to the Jaspersoft community edition download ×

Access subreport variable from main report


ktrinad

Recommended Posts

By: Julio Ortuzar - jortuzar

Access subreport variable from main report

2003-06-30 14:29

Hi, suppose I have the following:

Manirpt

Subrpt1

var1=sum(something)

Subrpt2

var2=sum(something)

 

Is there a way to make a variable from Mainrpt that would look something like:

var3 = Subrpt1.var1 + Subrpt2.var2

 

Thanks,

 

Julio Ortuzar

 

 

 

 

 

By: Giulio Toffoli - gt78

RE: Access subreport variable from main report

2003-06-30 14:49

Yes.

 

Take a look at:

https://sourceforge.net/forum/message.php?msg_id=1746736

Link to comment
Share on other sites

  • 4 years later...
  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

I too am faced with the same problem.

I have two detail bands (detail1,detail2) in my main report. They contain two independent subreports.

They both return two double values to the main report. This is hapenning properly. I know this because I can print them seperately in the column footer.

But in the column footer I need to display the simple total of the two. I.e. I have defined the $V{grandtotal}

varialble of which the evaluation expression is $V{var1}+$V{var2} where var1 and var2 are the variables that catch up the return values from the subreports.

When I print the $V{grandtotal} it displays null always no matter what I do.

Please help me with the issue as this is urgent. Any help is greatly appreciated. I am using ireport 4.0.2.

Thanks a lot,

Chaminie.

Link to comment
Share on other sites

Thanks for the suggestion.

Yes, I am using the return values and both my subreports return values to my main report properly because I print them in the main report.

The problem is with using a third variable to sum up the two variables that contain  the return values from the subreports.

It always yeilds null.

Thanks

Chaminie.

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