Hi everyone, I know this post represents yet another post on subreports' datasource, but I can't find anywhere a working solution! This is the XML I want to use for datasource.<reports> <report id="R"> <X>..</X> ... </report> <report id="S"> <Y>..</Y> ... </report></reports> Through XPath /reports/report[@id=R]/X and /reports/report[@id=R]/Y I can manage to select the data from the above xml.So far so good. Given the subreport S, I declare at the top of the jrxml <field name="data" class="java.lang.String"> <fieldDescription><![CDATA[data]]></fieldDescription></field> <parameter name="mySubreport" class="net.sf.jasperreports.engine.JasperReport"/> and I use the field $F{data} in the DETAIL section. Given the report R, I declare at the top of the jrxml <field name="data" class="java.lang.String"> <fieldDescription><![CDATA[data]]></fieldDescription></field> and I use the SUBREPORT tag in the SUMMARY section <subreport> <reportElement ..../> <subreportParameter name="data"> <subreportParameterExpression><![CDATA[$F{data}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{mySubreport}]]></subreportExpression></subreport> The Java code I'm trying to develop is JRXmlDataSource jrDS_sub = new JRXmlDataSource(xmlDom, " /reports/report[@id=S]/Y");JasperDesign subJD = JRXmlLoader.load(designPath + sub_03Design);JasperReport subJR = JasperCompileManager.compileReport(subJD);JasperPrint subJP = JasperFillManager.fillReport(subJR, null, jrDS_sub); JRXmlDataSource jrDS_report = new JRXmlDataSource(xmlDom, " /reports/report[@id=S]/Y");JasperDesign reportJD = JRXmlLoader.load(designPath + reportDesign);JasperReport reportJR = JasperCompileManager.compileReport(reportJD); // BUT....subJR is a JasperReport class type, where the report is not filled yet. I should insert a JasperPrint class type, where// the data has been filled!params.put("mySubreport", subJR);JasperPrint reportJP = JasperFillManager.fillReport(reportJR, null, jrDS_report); JasperExportManager.exportReportToPdfFile(reportJP, ".."); And now? Thanks in advance The result is