【问题标题】:Create SubReports in Jasper Report using Java使用 Java 在 Jasper Report 中创建子报表
【发布时间】:2017-04-30 21:41:08
【问题描述】:

我有两个收藏品如下

客户

cid : 1 |姓名:约翰;

cid : 2 |姓名:约瑟夫;

订购

cid : 1 | itemNo: 1 itemName: Mobile;

cid : 1 |项目编号:2 项目名称:笔记本电脑;

cid : 2 |项目编号:1 项目名称:iPad;

cid : 2 |项目编号:2 项目名称:iPhone;

cid : 2 | itemNo: 3 itemName: Mobile;

谁能解释一下如何以下面的模式将上述集合显示为报告?

cid : 1 |姓名:约翰;

itemNo: 1 itemName: Mobile;

itemNo: 2 itemName: LapTop;

cid : 2 |姓名:约瑟夫;

itemNo: 1 itemName: iPad;

itemNo: 2 itemName: iPhone;

itemNo: 3 itemName: Mobile;

【问题讨论】:

    标签: jasper-reports subreport


    【解决方案1】:

    我会在代码中对它们进行分组,然后将一组 bean 对象与客户及其购买的物品一起传递给报告。您可以使用该 bean 对象来格式化报告。

    bean 将具有成员变量cidcustName,以及带有相关项目信息的Order 对象集合。将这些 bean 的列表传递给报告,您应该可以根据需要格式化报告。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-19
      • 1970-01-01
      • 2012-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多