4

So I've been able to make a second data source, pass down parameters, im all but ready, but I cant figure out how to send a collection of the field values in a column to the sub report. Ive tried setting a variable to the field value and sending that, I've tried sending the field directly.

I sort of assumed these wouldn't work because the data type is wrong, but i just don't know how to tell jasper that i want the fields as a collection.

Alex K
  • 22,315
  • 19
  • 108
  • 236
Mr. MonoChrome
  • 1,383
  • 3
  • 17
  • 39

1 Answers1

0

I use this in JasperSoft Studio 5.6.0 and it work fine :

<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{subReportDataField})]]></dataSourceExpression>

Where "subReportDataBean" is a field like this :

<field name="subReportDataBean" class="java.util.List">
    <fieldDescription><![CDATA[subReportDataBean]]></fieldDescription>
</field>