This is a snippet of master report. Two parameters and the connection (for example, jdbc) are passing to the subreport. One value is returned from the subreport back to the master report, this value (variable) can be used in master report
<subreport>
<reportElement x="0" y="80" width="200" height="100"/>
<subreportParameter name="someSubreportParameter">
<subreportParameterExpression><![CDATA[$P{someMasterReportParamter}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="anotherSubreportParameter">
<subreportParameterExpression><![CDATA["Some text - constant value"]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<returnValue subreportVariable="someVariableInSubreport" toVariable="someVariableInMasterReport"/>
<subreportExpression><![CDATA["$P{SUBREPORT_DIR} + "subreport.jasper"]]></subreportExpression>
</subreport>