-1
Hello, I have a variable inside a subreport and I want to pass it to the mainreport, but for some reason the variable is arriving with null in the main report. I created an exmeplo variable To in the two reports to illustrate.
Variable declaration in subreport
...
<variable name="A" class="java.lang.String" resetType="None">
<variableExpression><![CDATA["teste"]]></variableExpression>
</variable>
...
Variable declaration in mainreport
...
<variable name="A" class="java.lang.String" resetType="None">
<variableExpression><![CDATA[]]></variableExpression>
</variable>
...
Call on the mainreport
...
<subreport runToBottom="false">
<reportElement uuid="5e524426-f04b-47d8-b7cd-2be45f031ebd" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="0" y="4" width="391" height="10" isPrintWhenDetailOverflows="true"/>
<returnValue subreportVariable="A" toVariable="A"/>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "subreport.jasper"]]></subreportExpression>
</subreport>
...
Thanks in advance.