Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Make Group Name appear when there are no Details Post Reply Post New Topic
Author Message
carstowal
Groupie
Groupie


Joined: 31 Jul 2008
Online Status: Offline
Posts: 80
Quote carstowal Replybullet Topic: Make Group Name appear when there are no Details
     Posted: 07 Oct 2009 at 10:26am
CR 9

The problem is if an employee is Paid, their Hours Paid appear in the TABLE.Non_Vac_Hrs
BUT if they didn't report any hours in the LABOR_TICKET table for the week in which they were paid, they are excluded from the report.

I need a way to make the employee appear in the Main report even though there are no details in LABOR_TICKET.HOURS_WORKED /  LABOR_TICKET.TRANSACTION_DATE  for them.

MAIN REPORT:
(Grouped by Employee & Date weekly)

GroupName1 LABOR_TICKET.EMPLOYEE_ID (linked to TABLE.Mfg_ID)
GroupName2 LABOR_TICKET.TRANSACTION_DATE}, "weekly"

LABOR_TICKET.TRANSACTION_DATE are daily
TABLE.for_Wk_Ending are Saturday only

Details are LABOR_TICKET.HOURS_WORKED  (there are anywhere from 1 line to 50 lines per single day per employee)


since the labor is reported daily, I have grouped it into weeks. The group name is equal to Sunday's date so I created a formula to determine the last day, Saturday, of that Group.
@WeekEndingDT = CDateTime (GroupName ({LABOR_TICKET.TRANSACTION_DATE}, "weekly")) +6



I have a Subreport that brings in the hours paid for the week ending "XXX" which is a Saturday date.

TABLE.Non_Vac_Hrs  is hours paid
TABLE.for_Wk_Ending is linked to @WeekEndingDT
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Oct 2009 at 1:07pm
You need a source table that has a list of all 'active employees' then you can left join that in a command to the LABOR_TICKET table using an and clause for the LABOR_TICKET record date being in the last month.
Do your group1 on the new source table employee name
IP IP Logged
carstowal
Groupie
Groupie


Joined: 31 Jul 2008
Online Status: Offline
Posts: 80
Quote carstowal Replybullet Posted: 07 Oct 2009 at 1:16pm
I'm confused by your reply.

It doesn't matter whether my employees are active or not.  Actually, if they were active during the reporting Date Range and inactive at the time of report generation, that would omit them from the report.

The goal is trying to find the employees who are getting paid for the week and failing to post any time on any day during that week to a job in house.

As soon as I put the labor times posted into the details those employees who fail to report their labor are immediately dropped from the Crystal Report.

Also, the "month" has nothing to do with the report.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Oct 2009 at 1:26pm
Sorry to confuse you. I thought you were doing a month at a time hence the month reference. As for the rest I obviously didn't get your table set up. Basically you have to have a source that is a 'master list' of all your employees. From there you have to outer join that into the report and use it for grouping.
The trickier part is that if you start to use crystal for the select statement you can turn an outer join back into an inner join hence my recommendation of using a Command (if possible use a stored proc or view in your source rather than a command).
What are all the tables you are using and how are they joined? Do you have source table of active employees you can use?
 


Edited by DBlank - 07 Oct 2009 at 1:27pm
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum