Subreport:
<variable name="rota" class="java.lang.String" resetType="None">
<variableExpression><![CDATA["ola"]]></variableExpression>
<initialValueExpression><![CDATA["ola"]]></initialValueExpression>
</variable>
Main Report:
<variable name="rota" class="java.lang.String" resetType="None"/>
<title>
<band height="41">
<textField isBlankWhenNull="false">
<reportElement x="0" y="6" width="100" height="30" uuid="e7e71af8-3694-4255-9b94-0587f377f7d4"/>
<textElement markup="html">
<font size="18"/>
</textElement>
<textFieldExpression><![CDATA[$V{rota}]]></textFieldExpression>
</textField>
</band>
</title>
<detail>
<band height="282">
<printWhenExpression><![CDATA[$V{REPORT_COUNT} == 1]]></printWhenExpression>
<subreport>
<reportElement x="-10" y="0" width="560" height="200" isPrintInFirstWholeBand="true" uuid="4bd58f02-975c-430f-87ad-41a55bd422ea">
<printWhenExpression><![CDATA[$V{PAGE_COUNT} == 1]]></printWhenExpression>
</reportElement>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<returnValue subreportVariable="rota" toVariable="rota"/>
<subreportExpression><![CDATA["C:/Users/Pedro Fernandes/JaspersoftWorkspace/MyReports/ticketspartidasubreport.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
The variable $F{rota} is always NULL on main report. I know that this topic was already posted, but none of the solutions were working for me. Can someone help me? thks!