I'm having an issue with iReport using subreports, I'm using a XML source.
XML SOURCE
<bordereaux>
<bordereau>
<pages>
<page>
<numpage>1</numpage>
<dosimetres>
<dosimetre>
<information>information</information>
</dosimetre>
<dosimetre>
...
</dosimetre>
<dosimetre>
...
</dosimetre>
</dosimetres>
</page>
<page>
...
</page>
<page>
...
</page>
<page>
...
</page>
</pages>
</bordereau>
<bordereau>
...
</bordereau>
<bordereau>
...
</bordereau>
<bordereaux>
Problem description
My main report is iterating on the < bordereau > nodes.
A subreport (in the main report) is iterating on the < page > nodes, with a page break in the bottom of the "Detail section".
(A subsubreport in the subreport if iterating on each < dosimetre > node, but it's not important in my problem)
What I need to do is, in the "Page Footer" section of my main report, show the value of the < numpage > node.
What I did
I added 1 variable named "numPage" on each report, both are java.lang.String
The one on my subreport has for "Variable Expression" $F{numpage}.
The one on my main report is linked to the first one by my subreport in the "Return Values" property
What I get
My main report is nicely iterating on my < bordereau > node
My subreport is nicely iterating on my < page > node
If I print the $F{numpage} field in my subreport, I can see it.
If I print the variable $V{numPage} in my subreport, I can see it.
BUT if I print the variable $V{numPage} in my main report, I can only see it's value for the last "< page > node iteration", otherwise I get a nice and smooth "null"
I don't know what to do ... I tried to play with the "Reset type" of the variables, to play with the "Evaluation time" of textfields. But every try was effectiveless ...
See you
I hope I explained my problem nicely, I'm not a native english speaker, so I'm apologising for the bad english ... My english is bad ... and I should feel bad !
Thanks a lot for any help.
Nicolas