Jump to content
We've recently updated our Privacy Statement, available here ×

How to read VARIABLES of subreport in main report?


nkamir

Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

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 report

In X report for the sub-var set the properties as :-

----------------------------------------------------------------------

Variablename---sub-var

class---depending  which datatype u want to return

Calculation---Nothing

Increment type---Nothing

Variable 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-var

class---required datatype

Calculation---Nothing

Increment type---Nothing

Variable 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

 

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

  • 1 month later...

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

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