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!

Newbie help with Crystal XI

Status
Not open for further replies.

ChewDoggie

Programmer
Mar 14, 2005
604
US
G'morning,

I realize I may be asking too much. If so, let me know.

Continuing on a previous thread I began, I have been given an assignment to "improve" a report by breaking down the detail portion of the report by 'Shift' (1st shift, 2nd shift, 3rd shift).

Right now, the report displays a list of departments -- Departemnt #, Department Name, Total Regular hours, Total Premium hours. When he user double-clicks on a Department Name or Department #, a detailed report displays a breakdown of the hours -- Employee Name, Wage Type (regular or Premium), hours billed.

They want the detailed report to display the current data on a PER SHIFT basis. The odd thing is that the shift information appears in a field called LABORLEVEL and the data is a combination of the Dept # and the Shift Code ("05103A", e.g., where "A" is the 1st shift, "B" is the 2nd shift, etc).

I don't have enough knowledge of CR to know where to begin. FYI...it's Crystal Reports XI release 2, with SQL Server 2008. Pointing me to an online tutorial would be acceptable, but they're gnawing on my hindquarters regarding a deadline.

Thanks !

Chew

10% of your life is what happens to you. 90% of your life is how you deal with it.
 
First create a formula field where it is equal to the A,B, etc for the shift,, that become a group, So the report has dept as a group and also shift as a group,, then drilling down into the shift gives you the people. I would copy the crystal report,,save as a new name,, and do the work on the new,, Should not take more than 1 hour at most. OK 2 since you are very new.
 
jmd0252 ... Thank you very much !

I did what you said and the formula looks like this:

Code:
IF (RIGHT({VP_TOTALS.LABORLEVELNAME3}, 1) = "A") THEN
    "1st Shift"
ELSE IF (RIGHT({VP_TOTALS.LABORLEVELNAME3}, 1) = "B") THEN
    "2nd Shift"
ELSE
    "3rd Shift"

I then dragged the field out onto the detail portion of the form and ran the report with new params. The report displays "1st Shift" on ALL of the detail records, even though I KNOW that that isn't correct. When I copy the SQL Query into a query window in SQL Server Mgmnt Studio, the data displays 3 different shifts for the department in question but the report does not.

Any further advice would be greatly appreciated.



10% of your life is what happens to you. 90% of your life is how you deal with it.
 
OK, I've expanded the "Selection Formulas" (Record Selection) to look like this:

Code:
RIGHT(TRIM({VP_TOTALS.LABORLEVELNAME3}), 1) IN ["A", "B", "C"] AND
{VP_TOTALS.APPLYDATE} >= {?StartDate} AND
{VP_TOTALS.LABORLEVELNAME1} = {?CompanyCode} AND
{VP_TOTALS.APPLYDATE} <= {?EndDate} AND
{VP_TOTALS.PAYCODEID} = {?PayCodes} AND
{VP_TOTALS.WAGEAMOUNT} <> 0

and, much to my surprise, it works ! The shift info is appearing. However, I'd like to group the results so that "1st Shift" appears first, "2nd Shift" second, etc.

Does anyone know how to accomplish this ?

Thanks !

Chew

10% of your life is what happens to you. 90% of your life is how you deal with it.
 
Hi,
Try Using this formula as the Shift Group instead of your current shift Formula (Include it in the details, but not as a group):
@NewGroup
Code:
ToNumber(@ShiftFormula[1])






[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top