I just started to work with iReport and got the task to do some changes to already existing reports.
Currently there's a main report with section A and B (contact details and some other info). There is a sub report C and then a subreport D. My task is to replicate A and B for every item in D. If the report has many D sections I want to have an A and B for each.
All data is in the same XML document and to get the data for section A and B I have simply
((net.sf.jasperreports.engine.data.JRXmlDataSource)$F{REPORT_DATA_SOURCE}).dataSource("/Header/")
and for sub report with D section
((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/Header/ProductHeader/Member")
if I drag a field from Document Structure that displays data in Section A to section D and check the expression it says $F{ContactNumber} but displays Null in D even though it displays a value in section A
How do I need to modify my data sources to display content of A and B in D?
Thanks in advance