ktrinad Posted August 31, 2006 Share Posted August 31, 2006 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 More sharing options...
chaminie Posted July 20, 2011 Share Posted July 20, 2011 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 More sharing options...
mfirkser Posted July 20, 2011 Share Posted July 20, 2011 I noticed one of the last properties of a subreport is return values. I have you tried using that? Link to comment Share on other sites More sharing options...
chaminie Posted July 21, 2011 Share Posted July 21, 2011 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.ThanksChaminie. Link to comment Share on other sites More sharing options...
mfirkser Posted July 21, 2011 Share Posted July 21, 2011 When are you evaluating the new variable? Link to comment Share on other sites More sharing options...
coffee_keyboard Posted July 21, 2011 Share Posted July 21, 2011 Try with Evaluation Time of the TextField where the third variable is used set to Report Post Edited by coffee_keyboard at 07/21/2011 14:46 Link to comment Share on other sites More sharing options...
chaminie Posted July 25, 2011 Share Posted July 25, 2011 Thanks for the suggestion.I tried it but I keep getting the same null value.Is there any other way? Chaminie Link to comment Share on other sites More sharing options...
vsambu Posted July 26, 2011 Share Posted July 26, 2011 Hi: In ordere not to get the null u need to set calculation type=system for the variable which u created. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now