0

Object is like this

class jobVO{ 
    ...
    List<taskVO> tasks;
    ...
}
class TaskVO{
    String name;
    ...
}  

I need to pass List to a jrxml and print.

I tried with subreports. but there I couldn't find a way to pass the params. Also tried with collection datasource also. There the problem I found was need to mention the factory method. My requirement is to create this report dynamically.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Suresh Kumar
  • 90
  • 1
  • 9
  • 1
    Possible duplicate of [JRBeanCollectionDataSource: How to show data from the java.util.List from JavaBean?](http://stackoverflow.com/questions/12209300/jrbeancollectiondatasource-how-to-show-data-from-the-java-util-list-from-javabe) – Alex K Jul 13 '16 at 07:42
  • or possible duplicate of [How to design report with tabular format?](http://stackoverflow.com/questions/34639662/how-to-design-report-with-tabular-format) – Petter Friberg Jul 15 '16 at 16:42
  • duplicate of JRBeanCollectionDataSource worked out.. Thanks Alex – Suresh Kumar Jul 19 '16 at 01:58

1 Answers1

0
created 2 subreports

<detail>
    <band height="60" splitType="Stretch">
        <subreport>
            <reportElement x="-19" y="34" width="560" height="26" uuid="7006626b-cfcb-4dcc-a1c8-3ef0f95e0440"/>
            <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{items})]]></dataSourceExpression>
            <subreportExpression><![CDATA["D:\\Root1\\WEB1\\src\\sub1.jasper"]]></subreportExpression>
        </subreport>
    </band>
</detail>
Suresh Kumar
  • 90
  • 1
  • 9