Link to home
Start Free TrialLog in
Avatar of gibneyt
gibneyt

asked on

Crystal Report with subreport calculation out of sync

I have a Crystal Report that lists Part Number per Group based on a date range.  I created a subreport that iterates through those part numbers to calculate the total labor cost per unit.  In the main report I then add the unit material cost and the total unit labor cost to get the extended total unit cost.  Problem is that extended cost calculation is out of sync by a line.  The report is taking the unit material cost and adding the next line's unit labor cost and making it that same line's extended cost.  Effectively it's as if the Labor column were shifted down one and started with 0.00.  See attached .pdf.  The subreport is placed in the details and returns the correct calculated unit labor cost.  Why is the Extended Cost out of sync?
Crystal-Reports---NashuaTotalDirectMater
NashuaTotalDirectMaterialAndHours.rpt
Avatar of Mike McCracken
Mike McCracken

Subreports are the last objects evaluated in a section so you cannot use the values of shared variables in that section.

The trick is to put the subreport into a section before the section you need them.

ALso you are trying to summarize a formula that uses the shared variables.  That can't be done.  You have to do a manual summary.

Look at the report I attached.

mlmcc
NashuaTotalDirectMaterialAndHours.rpt
Avatar of gibneyt

ASKER

I'm doing this in 8.5 because of the web front end systems still being used.  Can you save in 8.5 please?
Avatar of gibneyt

ASKER

mlmcc,

I was able to open in 11.5 but I need the report to be in 8.5 so it works in Crystal Enterprise 8.5.

I was able to make the changes but the output is as shown.  The extended cost calculation is not picking up the overlayed @TotalLaborDollars from the subreport.  Here's a .pdf output and the 8.5 report after fixes.
Crystal-Reports---NashuaTotalDirectMater
NashuaTotalDirectMaterialAndHours.rpt
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gibneyt

ASKER

DOH!  I hate it when that happens!  Works perfectly now.  Many thanks mlmcc
Avatar of gibneyt

ASKER

mlmcc,

When the Report Details are hidden, the calculation that use the overlayed field no longer works and the various totals go to zero.  Is that going to be the nature of the beast or is there some way to hide the Details and maintain the calculation?
I don't see the issue in the report you attached above.  

Which details are you hiding?  How are you hiding them?

mlmcc
Avatar of gibneyt

ASKER

Hiding the details in the main first report so that only the cost center totals appear shows only zero dollars.  I am hiding by clicking the Details margin and selecting "Hide".  See attached.  Also the grouping seems to have reverted to another field which I fixed in the attached report.
NashuaTotalLaborDollars.rpt
Do you need to be able to see the details by drilling into them?
If not you can delete all but the formulas.  
Change the formulas since the calculate variables to display nothing.
Hide the sections when blank.

See the attached report.

mlmcc
NashuaTotalLaborDollars.rpt
Avatar of gibneyt

ASKER

While the report is nascent the details need to be available when requested.  Once the values are accepted as a true representation of the data then no so much though from time to time the details may need to be parsed.  I will have to open in 11.5 and make the changes to the 8.5 version.
If you need the details then another approach is needed.

mlmcc