首页 > 解决方案 > JasperReport:在一份报告中显示多个列表

问题描述

我想在我的报告中显示多个列表。例如,我要显示这三个 DTO 列表:

Total vehicles : 3  
Porsche  
Ferrari  
Tesla  

Total vegetables : 2  
Potatoes  
Carot  
Salad  

Total fruits : 3  
Banana  
Apple  
Lemon

如何显示多个列表?
我习惯于通过使用此指令(在 java 端)填充报告来仅显示一个列表:

JasperPrint jp = JasperFillManager.fillReport(jr, new HashedMap(), new JRBeanCollectionDataSource(vegetables,false));

然后我通过显示 DTO 的属性在详细信息带中显示此列表。

我是否需要在一份报告中使用多个报告?或者我可以在一个报告中添加多个列表吗?
谢谢

标签: jasper-reports

解决方案


推荐阅读