简体   繁体   English

如何填充Jasper报告对于对象列表,其中每个对象内部都有一个对象列表?

[英]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.

相关问题 遍历对象列表的优化方案,每个Object都有列表Object - Optimized Solution For Traversing List of Objects and Each Object has List of Object 如何用对象数组列表中每个对象的成员填充选择列表? - How to populate a selection list with a member from each object in an array list of objects? Java 8 在对象列表中查找匹配的元素,其中每个对象都有另一个对象 - Java 8 find element matching in a list of objects where each object has another object 如何发送清单 <Object[]> 作为碧玉报告的数据源? - How to send List<Object[]> as datasource to jasper report? 如何使用 JDO 中的对象列表更新对象 - How to update object with a list of objects inside JDO 如何在Thymleaf中的对象内打印对象列表? - how to print List of Objects inside Object in Thymleaf? 分组对象列表,其中每个对象是 2 个元素数组 - Grouping list of objects where each object is 2 elements array 用对象列表填充ListView - Populate ListView with List of Objects Mapstruct:将对象内部的列表映射到对象列表 - Mapstruct: Map a list inside an object to a list of objects 过滤对象列表中的 object 列表 - Filtering list of object inside list of objects
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM