nkamir Posted February 4, 2009 Share Posted February 4, 2009 I'm able to pass parameters to the subreport but how can I read some of the variables or fields of subreport back in the main report? Link to comment Share on other sites More sharing options...
crusty_collins Posted February 5, 2009 Share Posted February 5, 2009 I have never done this but there is a return variables tab in the properties of the sub report.High leve I think you have to setup variables in both reports and set the caculation type to system. Link to comment Share on other sites More sharing options...
rameshinpower Posted February 6, 2009 Share Posted February 6, 2009 Let as assume u have two reports with name X and Y .You want to use report X as a Subreport to report Y, Declare one Variable(sub-var) in X report and one variable(main-Var) in Y reportIn X report for the sub-var set the properties as :-----------------------------------------------------------------------Variablename---sub-varclass---depending which datatype u want to returnCalculation---NothingIncrement type---NothingVariable Expression---Provide the field name($F{XYZ}) u want to use in report Y and for Y report varibale(main-var) set the properties as :---------------------------------------------------------------------------------Variablename---sub-varclass---required datatypeCalculation---NothingIncrement type---NothingVariable Expression---it should be empty Now,use this X report as a sub report in Y report,on clicking of sub-report(X) u wil get the properties of sub-report(X) in dat u wil find "Return Values",browse dat one ,click on add and provide the variables names which u declare in X report(sub-var) in "Subreport Varaible" and Y report(main-var) in "Local Destination Varibale" and "Caluculation Type" as "Nothing".Drag one text feild in Y report and provide the variable name (main-var) in the text feild expression ..Now,use this text filed for any type of calculation Post Edited by Ramesh Dudam at 02/06/09 06:58 Link to comment Share on other sites More sharing options...
nkamir Posted February 6, 2009 Author Share Posted February 6, 2009 When I set the calculation type to 'Sum' then it actually assigns the value, otherwise it shows 'null' May be it is just in my case, since I have a lot going on in my report, I don't know if something else is causing this, but its working fine, The attachment shows the screenshot. Thanks Ramesh Post Edited by Nasir Amir at 02/06/09 22:49 Link to comment Share on other sites More sharing options...
znuki Posted March 20, 2009 Share Posted March 20, 2009 Hi everyone, I am new at ireport. I have a subreport X and main report Y, I want to return variable from subreport X to Y . I declare variable subvar in subreport X and variable mainvar in Y. When I click on subreport X properties ,Subreport Other,Subreport return values and want to select variable subvar in the 'Subreport Variable' there appears only buit in vriables and there is no subvar.Could you please give me sum hints? Thanks in advance 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