Hi, ive proglem with creating subreports using xml datasource. I ve got this xml:
<root>
<user>
<name>John</name>
<hobbies>
<hobby>skiing</hobby>
<hobby>cykling</hobby>
</hobbies>
</user>
<user ...>
...
</root>
I want to print hobbies using subreport. First I created master report with Report query: /root/user . In master report user names (field name/text()) are shown (generated in output file) with now problem. Next I created subreport in detail section with Datasource expression: hobbies*hobby (or ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("hobbies") ) and in subreport I created field hobby/text(), but nothing is shown in subreport. I tried these subreport field values: hobbies/hobby/text() or just text() but nothing works. Only user names are shown. Thanks a lot for helping me.
<root>
<user>
<name>John</name>
<hobbies>
<hobby>skiing</hobby>
<hobby>cykling</hobby>
</hobbies>
</user>
<user ...>
...
</root>
I want to print hobbies using subreport. First I created master report with Report query: /root/user . In master report user names (field name/text()) are shown (generated in output file) with now problem. Next I created subreport in detail section with Datasource expression: hobbies*hobby (or ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("hobbies") ) and in subreport I created field hobby/text(), but nothing is shown in subreport. I tried these subreport field values: hobbies/hobby/text() or just text() but nothing works. Only user names are shown. Thanks a lot for helping me.
mike1011
18 Jul 2006