[英]How to populate Jasper report For a list of objects where each object has a list of objects inside?
Object is like this 对象是这样的
class jobVO{
...
List<taskVO> tasks;
...
}
class TaskVO{
String name;
...
}
I need to pass List to a jrxml and print. 我需要将List传递给jrxml并进行打印。
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.
我的要求是动态创建此报告。
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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.