显示多对一关系的组
我需要在 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
如果您有任何建议,请告诉我。
I need to create a JasperReport in iReport that lists employees info including degree and certification information.
My query returns all the data I need (i think) but I can't figure out how to do the groups and/or details in IReport so that it displays like I need.
Here is my query:
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
Here are results:
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
I need the report to display like this:
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
Let me know if you have any suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如 DaDaDom 建议的那样,使用一份报告和两个子报告:
报告 1 - 人员 子
报告 1.1 - 认证
子报告 1.2 - 学位
综合结果
然后:
按员工 ID 分组
。As DaDaDom suggested, use one report and two subreports:
Report 1 - Person
Subreport 1.1 - Certifications
Subreport 1.2 - Degrees
Combined Results
Then:
Group By
the employee ID.