Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group within a group

Status
Not open for further replies.

newmem

Programmer
Jul 23, 2002
35
US
Hi,
I have a report which is grouping on an Employee's data. Every Employee has been assigned a Manager. The report shows perfect with the first group i.e. Grouped by Employee. But now I want to group the Employees by their Manager so all the employees within a MAnager will be listed together. So I added another group 1 level up the Employee group. This works with the Manager group printing Manager ID only. But I need to display the MAnager's name alongwith his id. How do i accomplish this ?

My report should look like:

Manager: XXXX-ABCD
Emp Name Home no. Email Address
Mary (123)- 456 7890 mary@test.net
Jen (453)- 789 4567 jen@msn.net

Manager: XXXX-XYZ
Emp Name Home no. Email Address
John (345)- 124 5678 jj@test.net
Pam (222)- 145 8765 pam@msn.net

The database table looks like:
EMployee tbl:
EmpID
EmpName,
EmpPhNo
Email
ManagerID

(BTW, i'm using Crystal Report for .NET.)

Any help wold be appreciated.
Thanks.



 
Assuming that the managers are in your Employee table too, you should go to the Visual Linking Expert and then in the Tables\Add Tables dialog, add the Employee table again. It will give you a warning, and yes you do want to add another alias to the table. It will be aliased as Employee_1. Now link Employee.EmpID to Employee_1.ManagerID. The manager's name will be available in the field Employee_1.EmpName.

Good luck!
 
You can simply put both fields side by side on the Group Header, or you can concatenate the Name and ID into one formula field, and group on the formula. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Thank you both for the suggestions. It worked!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top