Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum of Variables from Subreport again!

Status
Not open for further replies.

pomster

Technical User
Jan 15, 2003
88
AU
I thought I had got my head around this 12months ago. However after a few months away from Crystal I have brain fade.

I have a variable leavevar in a subreport in GF2a (techID)
My main report is grouped in to G1 Region , G2 techID and G3 calltype.
Iam trying to use the 3 variable approach to total leavevar by region and grand total (report footer)

This is what I have at the moment,

//@Formula1
WhilePrintingRecords;
Shared NumberVar LeaveVar;NumberVar LeaveTotal;LeaveTotal := LeaveTotal + LeaveVar;

//@Formula2
WhilePrintingRecords;
NumberVar LeaveTotal;

//@Formula3
WhilePrintingRecords;
NumberVar LeaveTotal := 0;

I have totally confused myself as to where to place each formula (assuming they are correct)

I have used this way in other reports and had no problems but today? I also need to subtract leavevar from a field on the main report, do I need to do the same thing?

kind regards in advance,

David
 
I would change the formulas as follows:

//@Formula1 to be placed in GF2b:
WhilePrintingRecords;
Shared NumberVar LeaveVar;
NumberVar LeaveTotal;
NumberVar GrTotal;
LeaveTotal := LeaveTotal + LeaveVar;
GrTotal := GrTotal + LeaveVar;

//@Formula2 to be placed in GF1 for the Group Subtotal:
WhilePrintingRecords;
NumberVar LeaveTotal;

//@Formula3 to be placed in GH1 to reset the Group Subtotal:
WhilePrintingRecords;
NumberVar LeaveTotal := 0;

//{@Formula4} to be placed in the report footer:
WhilePrintingRecords;
NumberVar GrTotal;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top