Link to home
Start Free TrialLog in
Avatar of C_Patrick
C_PatrickFlag for United States of America

asked on

Crystal Report Shared Variable Value Lagging Behind SubReport Value

I've created a Crystal Report to display the sum of labor hours taken from two separate, and disconnected data tables.  The report is meant to compare the total labor hours from each of the tables, and identify discrepancies.  The report information is grouped first by person, then by payroll date.  In a main report, I've created the person and payroll date groupings, and a column which displays the sum of labor hours from one of the mentioned tables in the payroll date group's footer.  In a second column, I've inserted a subreport which provides the labor hours summary from the second data table.  This report works fine, but I'd like to condition the color of the payroll date field to change when there are discrepancies between the two labor hour column values.

To provide for a conditional check, I've created a shared numeric value in both the main report, and the subreport.  In the subreport, I have a formula which sets the shared variable's value to that of the labor hours sum in the same group footer of the labor hours sum.  In the payroll date of the main report, I check the shared variable's value to that of the labor hours sum in the main report, to conditionally set the payroll date's font color.

The problem is that the shared variable's value seems to lag behind the actual labor hours sum returned by the subreport, and is present during the conditional check for the following record.  I've included a screenshot of the report's result.

Any help in understanding when the shared variable's value is being set would be much appreciated.
laborHedvsLaborDtl.jpg
ASKER CERTIFIED SOLUTION
Avatar of James0628
James0628

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 C_Patrick

ASKER

Your proposed solution works, James.

Thanks for your time in providing a detailed explaination of the problem, and its solution!

C. Patrick
Avatar of James0628
James0628

You're welcome.  Glad I could help.

 James