How to get or assign a value to a variable of the main report into subreport variables?
If you use iReport in your subdirectory properties, find the Parameters property and click the button to the right of the text field.
This will open an input window.
Click the Add button in this field and add the necessary parameters.