BradCustom
IS-IT--Management
I'm using Crystal Reports 2016 and I'm having a problem with displaying the calculated running total in the report footer. As long as I don't Hide or Suppress the Detail or Group footer all of the formulas calculate correctly. If I Hide or Suppress the Detail or Group footer (which is what I want to do) the running calculation displays a value that doesn't make any sense. I'll describe the report structure and formulas as best I can below.
The main report has three tables Job, Job_Operation and Job_operation_Time
There is one Subreport which has one table Job_Operation the subreport is linked to the main report by the Job field. I'm using the Job Operations subreport to find the Max job.sequence I pass that value to the main report. The subreport is in Details B section, all the of other fields are in Details A section. The Scrap Cost Each formula is in Group 1 footer.
Group 1 = Job
Group 2 = Work Center
Below are the formulas I'm using to calculate the the scrap cost for each detail line,
Below is the formula I using to create a running total for the scrap cost.
Below is the formula to display the running total in the Report Footer.
Hopefully I gave enough information, if I didn't please let me know.
Thank you for your help!
The main report has three tables Job, Job_Operation and Job_operation_Time
There is one Subreport which has one table Job_Operation the subreport is linked to the main report by the Job field. I'm using the Job Operations subreport to find the Max job.sequence I pass that value to the main report. The subreport is in Details B section, all the of other fields are in Details A section. The Scrap Cost Each formula is in Group 1 footer.
Group 1 = Job
Group 2 = Work Center
Below are the formulas I'm using to calculate the the scrap cost for each detail line,
Code:
whileprintingrecords;
shared currencyvar ScrapCost :=
scrapcost +
(if {Job_Operation.Sequence}=0
then
({@LineCostEa}*(({Job_Operation.Sequence}+1)/({@Pass_JobOpSeq}+1)))*{Job_Operation_Time.Act_Scrap_Qty}
else
if {@Pass_JobOpSeq}=0
then
({@LineCostEa}*(({Job_Operation.Sequence}+1)/({@Pass_JobOpSeq}+1)))*{Job_Operation_Time.Act_Scrap_Qty}
else
({@LineCostEa}*({Job_Operation.Sequence}/{@Pass_JobOpSeq}))*{Job_Operation_Time.Act_Scrap_Qty})
Below is the formula I using to create a running total for the scrap cost.
Code:
whileprintingrecords;
shared currencyvar ScrapCost :=
scrapcost +
(if {Job_Operation.Sequence}=0
then
({@LineCostEa}*(({Job_Operation.Sequence}+1)/({@Pass_JobOpSeq}+1)))*{Job_Operation_Time.Act_Scrap_Qty}
else
if {@Pass_JobOpSeq}=0
then
({@LineCostEa}*(({Job_Operation.Sequence}+1)/({@Pass_JobOpSeq}+1)))*{Job_Operation_Time.Act_Scrap_Qty}
else
({@LineCostEa}*({Job_Operation.Sequence}/{@Pass_JobOpSeq}))*{Job_Operation_Time.Act_Scrap_Qty})
Below is the formula to display the running total in the Report Footer.
Code:
whileprintingrecords;
shared currencyvar scrapcost
Hopefully I gave enough information, if I didn't please let me know.
Thank you for your help!