Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Variable result is shifted Post Reply Post New Topic
Author Message
carstowal
Groupie
Groupie


Joined: 31 Jul 2008
Online Status: Offline
Posts: 80
Quote carstowal Replybullet Topic: Variable result is shifted
     Posted: 24 Aug 2009 at 11:03am
Main report consists of a table showing hours posted, there are numerous rows for each DAY for the Group2 (person)

Subreport consists of a table showing hours paid for a WEEK.  There is one row of data with each Saturday's date for each person.

To eliminate the duplication (x7) of rows of data in the main report, I separated the hours paid for a week into a subreport and linked the Saturday date in Subreport to the Main Report formula @WeekEnding.  The persons' names are also linked.

Everthing works fine.

Now, I need to create a formula which takes @HrsPd in the Subreport and divides it by the Sum of the hours posted in the Main Report.
so I created the variable HP

In Subreport
@HrsPd
Shared NumberVar HP := {Table_.Non_Vac_Hrs};

In Main Report
@HrsPd
Shared NumberVar HP ;

in the Main Report GF2 the result is the @HrsPd for the Previous Group (and the first Group is Zero)

Example:

Name...Main...Subreport
          @HrsPd   @HrsPd
Bob.......0.........40
Sam.....40........32 . . . . . . . 32 is correct, 40 is for the previous Group 2
Fred.....32........38
Joe.......38........45
Tom.....45........40

IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum