我需要在 iReport 中创建一个 JasperReport,其中列出了员工信息,包括学位和认证信息。
我的查询返回了我需要的所有数据(我认为),但我无法弄清楚如何在 IReport 中执行组和/或详细信息,以便它按照我的需要显示。

这是我的查询:

select e.eid, e.first_name, e.last_name,
       d.degree_date, d.degree_name,
       c.cert_date, c.cert_name
from employees e, degrees d, certifications c
where e.eid = d.eid
and e.eid = c.eid

以下是结果:
1234, John, Smith, 01/01/2010, MCSE, 4/4/2001, B.S. Information Systems
1234, John, Smith, 01/01/2010, MCSE, 5/5/2004, M.S. Comupter Science
1234, John, Smith, 03/01/2010, CISSP, 4/4/2001, B.S. Information Systems
1234, John, Smith, 03/01/2010, CISSP, 5/5/2004, M.S. Comupter Science
1235, John, Rolph, 01/01/2010, Pottery Instruction, 6/6/2001, B.A. Fine Arts
1235, John, Rolph, 01/01/2010, Pottery Instruction, 7/7/2004, M.S. Education
1235, John, Rolph, 03/01/2010, Adv Pottery, 6/6/2001, B.A. Fine Arts
1235, John, Rolph, 03/01/2010, Adv Pottery, 7/7/2004, M.S. Education

我需要报告像这样显示:
Employee ID Employee Name
1234    John Smith
        Certifications:
        01/01/2010 MCSE
        03/01/2010 CISSP
        Degrees:
        4/4/2001 B.S. Information Systems
        5/5/2004 M.S. Comupter Science

1235    John Rolph
        Certifications:
        01/01/2010 Pottery Instruction
        03/01/2010 Adv Pottery
        Degrees:
        6/6/2001 B.S. B.A. Fine Arts
        7/7/2004 M.S. Education

如果您有任何建议,请告诉我。

最佳答案

正如 DaDaDom 建议的那样,使用一个报告和两个子报告:

报告 1 - 人

1234    John Smith

子报告 1.1 - 认证
        01/01/2010 MCSE
        03/01/2010 CISSP

子报告 1.2 - 学位
        4/4/2001 B.S. Information Systems
        5/5/2004 M.S. Comupter Science

综合结果

然后:
  • 将组带添加到主报告中。
  • Group By 员工 ID。
  • 在组带中包含证书子报告。
  • 在组带中包括度数子报表。
  • 将员工 ID 从主报表传递到子报表。
  • 让每个子报表根据他们收到的员工 ID 参数查询必要的信息。
  • 10-07 19:38
    查看更多