# From the Report Inspector, '''right click''' on the '''Parameter''' tree and choose '''Add Parameter'''.
#: [[Image:IReport AddParameter1.png|center|250px|''Add Parameter'']]
# In the '''Properties''' pane, enter a parameter name (e.g. ItemGUID} and edit any other properties. Normally it is not required to edit anything other than the name, you might however want to deselect the '''Use as a prompt''' option.
#: [[Image:IReport AddParameter2.png|center|250px|''Add Parameter'']]
# Once the parameter is added it will be available in the '''Report Inspector''' and can be referenced as ''$P{parametername}''. For example:
====Step 4 – Define Report Query for Subreport====__NOEDITSECTION__
The next step is to create a report query for the subreport you just created in Step 3 2 to define how the IMSMA item on the main report is related to the IMSMA item on the subreport. Typically the subreport Report Query report query will receive the guid from the main report via the parameter created in Step 4 3 and then use it to limit items in the subreport to those linked to the main report. Below is the instructions on how to define the Report Queryreport query:
# Open the [[Modify an iReport Template#Using Report Query filters|Report Query report query window]].# From the Report report query window, select '''ImsmaQuery''' from the Query query language list.# Enter a Report Query report query filter using the parameter defined above to limit the objects according to the main report object. The most common Report Query report query filter would be to filter to only linked objects. For example '''''links.toGuid="$P{ItemGUID}"'''''. In this step, the Report Query tells the subreport to return only rows that are linked to the guid of the the item in the main report via the link table. Other combinations of Report Query report query filters can be used on subreports beyond the link table. These are documented in the [[#Example Subreport Relationships|Possible Subreport Relationships]] section below.# Click '''OK'''. The Report report query window closes.
# Save the subreport.
====Step 5 – Add Subreport Parameter to Main Report====__NOEDITSECTION__
We created a parameter on the subreport to connect to the main report in Step 3, now we need to create a parameter on the main report as well. Below is the instructions to create the parameter you need for the Main main report:
# Make sure you are at the Main report by selecting the name of the main report from the tabs at the top of the iReport Designer canvas pane.
# Select the subreport box within the main report.