Jump to content

Pass a value from MAIN report to a parameter in SUBREPORT


jkeri

Recommended Posts

I have a MAIN report with a SUBREPORT.   What i want to do is to pass a field in my MAIN report ($F{USERNAME}) to the parameter in my subreport ($P{SUB_USERNAME}). Basically, for every detail record in my MAIN report I want to pass the username to the SUBREPORT.

Not sure if or even how this can be done.... Any ideas would be appreciated.

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

In order to pass a field from Main report to a subreport, first of all you have to create a parameter in your subreport. Ex: Name: SUB_USERNAME , Type: String
Then go to Main report and click on the subreport element. In the right side click in "edit parameter button". Map values from main report to subreport parameter.

I´m not sure if you are trying to pass just one value of USERNAME or ALL values.
If you want to pass to your subreport all values with just 1 parameter, then what you can make is a new parameter of type collection in the main report. With a variable add all those values and then pass that collection to your subreport.

Probably is easier to get those values from the subreport query, and pass as parameter a value to filter the where clause.

Regards, 
GL

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