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
gibneytAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
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
0
gibneytAuthor Commented:
I'm doing this in 8.5 because of the web front end systems still being used.  Can you save in 8.5 please?
0
gibneytAuthor Commented:
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
0
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

mlmccCommented:
Unfortunately there is no way to save from CR9 and later to CR8.5.  They added Unicode support to CR9 along with a couple of other features and decided they wouldn't allow you to save back to previous versions.

Issue is you have the shared variable named 2 ways
Subreport - varLaborTotal
Main Report - varTotalLabor

Change the main report labor formula to
WhilePrintingRecords;
Shared NumberVar varLaborTotal

Open in new window



mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gibneytAuthor Commented:
DOH!  I hate it when that happens!  Works perfectly now.  Many thanks mlmcc
0
gibneytAuthor Commented:
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?
0
mlmccCommented:
I don't see the issue in the report you attached above.  

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

mlmcc
0
gibneytAuthor Commented:
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
0
mlmccCommented:
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
0
gibneytAuthor Commented:
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.
0
mlmccCommented:
If you need the details then another approach is needed.

mlmcc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.