I am using a Json data source for my report. The json record contains some fields as well as a list of articles I need to iterate. So the json record would look something like the following:
{"client":"John Doe","invoiceNumber":"INV001",
"articles":[{"name":"Article1","price":40.00},{"name":"Article2","price":50.00}]}
I added a data set in my report for these articles and then added a list element for this data set to iterate the set. But the articles never get iterated on report generation. I have run the report through the jasper library to discover I am getting a warning in JsonQueryExecuter.createDatasource "No JSON source was provided". But when I created my list I specified "Use same connection to fill list". Can someone please tell me what the issue is here?
For reference here is a test report that does not iterate the articles:
<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="Blank_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="81afe112-ee1b-4443-8d1c-cb6d9ab95dd8">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Json Test"/>
<subDataset name="Articles" uuid="fa853735-039f-482e-b16b-fad34f35c354">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Json Test"/>
<queryString language="json">
<![CDATA[articles]]>
</queryString>
<field name="name" class="java.lang.String">
<fieldDescription><![CDATA[name]]></fieldDescription>
</field>
<field name="price" class="java.lang.String">
<fieldDescription><![CDATA[price]]></fieldDescription>
</field>
<group name="name">
<groupExpression><![CDATA[$F{name}]]></groupExpression>
</group>
<group name="price">
<groupExpression><![CDATA[$F{price}]]></groupExpression>
</group>
</subDataset>
<queryString language="json">
<![CDATA[articles]]>
</queryString>
<field name="name" class="java.lang.String">
<fieldDescription><![CDATA[name]]></fieldDescription>
</field>
<field name="price" class="java.lang.String">
<fieldDescription><![CDATA[price]]></fieldDescription>
</field>
<title>
<band height="79" splitType="Stretch">
<componentElement>
<reportElement x="0" y="10" width="253" height="36" uuid="c3237c70-6b2e-43e3-aa21-5092d8b91afc"/>
<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="Articles" uuid="822fffb6-6a34-442e-a9dd-01fcbc25fbdc">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:listContents height="36" width="253">
<textField>
<reportElement x="10" y="0" width="100" height="30" uuid="07e3ff2a-3832-4b06-9275-cb1ee8e51cfe">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="120" y="3" width="100" height="30" uuid="d58f36cb-41eb-4399-a0d9-a181f02c4931">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{price}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</band>
</title>
</jasperReport>