saphir54321
Programmer
Hi Everybody,
I'm new with Crystal Report and I have a few questions.
I have a table who has an attribute which is a foreign key of the table itself.
Code:
Company {id, compName}
Department {id, companyId, departmentId, depName}
- we can then have sub departments
- departmentId will be null if it's the top level
Report {id, companyId, report}
Work {id, reportId, departmentId, work}
I need to display something like this:
Code:
Departments Name Nb Work
Dep 1 5 //Sum of Sub Dep 11 and SubDep 12
Sub Dep 11 3 // Sum of Sub Sub Dep 111 and Sub Sub Dep 112
Sub Sub Dep 111 1
Sub Sub Dep 112 2
Sub Dep 12 2 // Same process than Sub Dep 11
Sub Sub Dep 121 1
Sub Sub Dep 122 1
Sub Sub Dep 123 0 // I would like to display 0 for the departments without works
Dep 2 4 // Same process than Dep1
Sub Dep 21 1
Sub Dep 22 0
Sub Dep 23 3
What I have so far:
Parameter entered by user:
Sort data by Company.Id AND Report.Id
I have a group on the Department.id
To calculate nb work: count ({Work.departmentId}, Department.id)
How can I:
1) Indent depending on the department level
2) Have zero for the departments without works
3) The sum of the sub departments for departments with sub departments
Thanks a lot
saphir
I'm new with Crystal Report and I have a few questions.
I have a table who has an attribute which is a foreign key of the table itself.
Code:
Company {id, compName}
Department {id, companyId, departmentId, depName}
- we can then have sub departments
- departmentId will be null if it's the top level
Report {id, companyId, report}
Work {id, reportId, departmentId, work}
I need to display something like this:
Code:
Departments Name Nb Work
Dep 1 5 //Sum of Sub Dep 11 and SubDep 12
Sub Dep 11 3 // Sum of Sub Sub Dep 111 and Sub Sub Dep 112
Sub Sub Dep 111 1
Sub Sub Dep 112 2
Sub Dep 12 2 // Same process than Sub Dep 11
Sub Sub Dep 121 1
Sub Sub Dep 122 1
Sub Sub Dep 123 0 // I would like to display 0 for the departments without works
Dep 2 4 // Same process than Dep1
Sub Dep 21 1
Sub Dep 22 0
Sub Dep 23 3
What I have so far:
Parameter entered by user:
Sort data by Company.Id AND Report.Id
I have a group on the Department.id
To calculate nb work: count ({Work.departmentId}, Department.id)
How can I:
1) Indent depending on the department level
2) Have zero for the departments without works
3) The sum of the sub departments for departments with sub departments
Thanks a lot
saphir