jkeri Posted June 12, 2018 Share Posted June 12, 2018 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 More sharing options...
jasperrocks Posted June 12, 2018 Share Posted June 12, 2018 Click on the subreport element in the main report and on the right side you will edit parameters button .select that and map the values you want to pass it from the main report to the subreport. Link to comment Share on other sites More sharing options...
GonzaLinares Posted June 13, 2018 Share Posted June 13, 2018 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: StringThen 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 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