Normally, we can pass anything from main dataset to a sub dataset or sub report. But the reverse seems to be non-feasible. Attached is a dummy jrxml for more context in defining the problem.
Suppose, we have to print the Field3 value in a text field under the main report (See attached jrxml).
I recently managed to pass values from subreport to main report using the "return values" menu.
For example, imagine you have a example_variable in your subreport, just click to return values,
add the variable name, create a variable with the same name in your main report with the parameter calculation = "System"
Have a great day !
Best regards, Arnaud