I am having trouble inserting nested data as a list. I believe the issue is about linking two datasets - parent to child, but I am not sure what I am doing wrong.
My XML source:
<?xml version="1.0" encoding="UTF-8"?>
<Event>
<EventItems>
<EventItem>
<Error.Code>AXCB</Error.Code>
<Severity.Code>Error</Severity.Code>
<Parameters>
<Parameter>
<Parameter.Identifier>ReportPartyTypeDimension</Parameter.Identifier>
<Parameter.Text>Payee</Parameter.Text>
</Parameter>
</Parameters>
</EventItem>
<EventItem>
<Error.Code>BGDFD</Error.Code>
<Severity.Code>Warning</Severity.Code>
<Parameters>
<Parameter>
<Parameter.Identifier>ContextID</Parameter.Identifier>
<Parameter.Text>09978qwew</Parameter.Text>
</Parameter>
<Parameter>
<Parameter.Identifier>Scheme</Parameter.Identifier>
<Parameter.Text>http://abc.com</Parameter.Text>
</Parameter>
<Parameter>
<Parameter.Identifier>Identifier</Parameter.Identifier>
<Parameter.Text>586144911</Parameter.Text>
</Parameter>
</Parameters>
</EventItem>
</EventItems>
</Event>
What I see is a list of each EventItem with an empty "Parameters" list (image attached):
Error.Code: AXCB. Severity.Code: Error
Parameters
Error.Code: BGDFD Severity.Code: Warning
Parameters
What I am expecting to see is a list of each EventItem with a sub-list of Parameters:
Error.Code: AXCB. Severity.Code: Error
Parameters
Payee ReportPartyTypeDimension
Error.Code: BGDFD Severity.Code: Warning
Parameters
09978qwew ContextID
http://abc.com Scheme
586144911 Identifier
My JRXML source:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.20.0.final using JasperReports Library version 6.20.0-2bc7ab61c56f459e8176eb05c7705e145cd400ad -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Responses_multiple_no-namespaces_simplified" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="bcb3c989-8b7b-4498-a248-89d6c507b3f6">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Data Adapter - Multiple Responses - No Namespaces - Simplified"/>
<subDataset name="EventItem_Parameters_Dataset" uuid="1c4eed1d-1cb4-4bed-982f-680f43dd95d6">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Data Adapter - Multiple Responses - No Namespaces - Simplified"/>
<queryString language="xPath">
<![CDATA[/Event/EventItems/EventItem/Parameters/Parameter]]>
</queryString>
<field name="Parameter.Identifier" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="Parameter.Identifier"/>
<fieldDescription><![CDATA[Parameter.Identifier]]></fieldDescription>
</field>
<field name="Parameter.Text" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="Parameter.Text"/>
<fieldDescription><![CDATA[Parameter.Text]]></fieldDescription>
</field>
</subDataset>
<queryString language="xPath">
<![CDATA[/Event/EventItems/EventItem]]>
</queryString>
<field name="Error.Code" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="Error.Code"/>
<fieldDescription><![CDATA[Error.Code]]></fieldDescription>
</field>
<field name="Severity.Code" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="Severity.Code"/>
<fieldDescription><![CDATA[Severity.Code]]></fieldDescription>
</field>
<detail>
<band height="222" splitType="Stretch">
<textField>
<reportElement x="90" y="0" width="139" height="19" uuid="ee828d4d-b903-4bb1-97de-fb001184983c">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b6f0e574-74a1-4049-a044-3acd0bfd5f7d"/>
</reportElement>
<textFieldExpression><![CDATA[$F{Error.Code}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="350" y="0" width="277" height="19" uuid="910ae679-1486-4dbf-bf52-b6df009a4e60">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bce7ec08-c457-44d6-9eb8-f08e147fb210"/>
</reportElement>
<textFieldExpression><![CDATA[$F{Severity.Code}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="20" width="102" height="18" uuid="08509c7c-d0e0-4f1a-8634-1239ca262f65"/>
<textFieldExpression><![CDATA["Parameters"]]></textFieldExpression>
</textField>
<componentElement>
<reportElement x="9" y="50" width="545" height="30" uuid="3803a4ec-e17a-4e8d-b187-279ad6741f16"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="EventItem_Parameters_Dataset" uuid="892e6ddf-08d3-4829-8c0e-0ed66efb1842">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/Event/EventItems/EventItem/Parameters/Parameter")]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="30" width="545">
<textField>
<reportElement x="170" y="0" width="375" height="30" uuid="7839d387-0121-402f-b71a-15c679697104"/>
<textFieldExpression><![CDATA[$F{Parameter.Identifier}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="0" width="170" height="30" uuid="2e374982-5c06-408f-adac-bbd975203783"/>
<textFieldExpression><![CDATA[$F{Parameter.Text}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<staticText>
<reportElement x="0" y="-1" width="90" height="20" uuid="50a0d324-b27b-4d3d-9d40-638e9ca0bd2c">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b6f0e574-74a1-4049-a044-3acd0bfd5f7d"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<text><![CDATA[Error.Code]]></text>
</staticText>
<staticText>
<reportElement x="238" y="-1" width="112" height="20" uuid="eeb72e9a-5bf3-4332-9aeb-6c54264bb324">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bce7ec08-c457-44d6-9eb8-f08e147fb210"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<text><![CDATA[Severity.Code]]></text>
</staticText>
</band>
</detail>
</jasperReport>