I am trying to get the sum of three number fields. Once that has been accomplished I need to have a grand total of those sums.
I am using Crystal 11 connected to an Access db.
To this point I am able to get everything I need by placing the fields in the Details section. All of the data comes from one table, “Summary”.
My data looks like this coming in;
Line/ShotPoint, ChargeWeight_1, ChargeWeight_2, ChargeWeight_3
123 1.1 1.1 2.2
124 2.2 1.1
125 2.2 1.1
What I need to show is;
Line/ShotPoint, Weight_1, Weight_2, Weight_3,@ShotPointTotal
123 1.1 1.1 2.2 4.4
124 2.2 1.1 3.3
125 2.2 1.1 3.3
@GrandTotal 11.0
NOTE: The value for ChargeWeight_3 is usually NULL.
I have tried the following;
For the ShotPointTotal I have tried to create a subreport with variables grouped by Line/ShotPoint. It has not worked so far. Results have been returning 0 at best.
I have three (3) “reset” formulas placed it the Group Header a.
//@Reset
WhilePrintingRecords;
NumberVar Weight1 :=0
//@Reset2
WhilePrintingRecords;
NumberVar Weight2 :=0
//@Reset3
WhilePrintingRecords;
NumberVar Weight3 :=0
For my formula placed in the Details section
//@ChargeWeightSum
WhilePrintingRecords;
NumberVar Weight:= {Summary.ChargeWeight_1};
NumberVar Weight2:= {Summary.ChargeWeight_2};
NumberVar Weight3:= {Summary.ChargeWeight_3};
//NumberVar ShotPointWeight := Weight + Weight2 = Weight3;
//I commented out the last line during testing since it was giving me an error, “A number is required //here.”
For my display formula, placed in the Group Footer #1
//@Display
WhilePrintingRecords;
NumberVar ShotPointWeight;
ShotPointWeight;
For the GrandTotal I have tried;
//@GrandTotalWeight
{Summary.ChargeWeight_1} + {Summary.ChargeWeight_2} + {Summary.ChargeWeight_3}
Placed in the Main Report, Report Footer. If I remove the last “+{Summary.ChargeWeight_3}” I get a result but not the desired one. This may be because of the NULL results?
Any help would be greatly appreciated.
I am using Crystal 11 connected to an Access db.
To this point I am able to get everything I need by placing the fields in the Details section. All of the data comes from one table, “Summary”.
My data looks like this coming in;
Line/ShotPoint, ChargeWeight_1, ChargeWeight_2, ChargeWeight_3
123 1.1 1.1 2.2
124 2.2 1.1
125 2.2 1.1
What I need to show is;
Line/ShotPoint, Weight_1, Weight_2, Weight_3,@ShotPointTotal
123 1.1 1.1 2.2 4.4
124 2.2 1.1 3.3
125 2.2 1.1 3.3
@GrandTotal 11.0
NOTE: The value for ChargeWeight_3 is usually NULL.
I have tried the following;
For the ShotPointTotal I have tried to create a subreport with variables grouped by Line/ShotPoint. It has not worked so far. Results have been returning 0 at best.
I have three (3) “reset” formulas placed it the Group Header a.
//@Reset
WhilePrintingRecords;
NumberVar Weight1 :=0
//@Reset2
WhilePrintingRecords;
NumberVar Weight2 :=0
//@Reset3
WhilePrintingRecords;
NumberVar Weight3 :=0
For my formula placed in the Details section
//@ChargeWeightSum
WhilePrintingRecords;
NumberVar Weight:= {Summary.ChargeWeight_1};
NumberVar Weight2:= {Summary.ChargeWeight_2};
NumberVar Weight3:= {Summary.ChargeWeight_3};
//NumberVar ShotPointWeight := Weight + Weight2 = Weight3;
//I commented out the last line during testing since it was giving me an error, “A number is required //here.”
For my display formula, placed in the Group Footer #1
//@Display
WhilePrintingRecords;
NumberVar ShotPointWeight;
ShotPointWeight;
For the GrandTotal I have tried;
//@GrandTotalWeight
{Summary.ChargeWeight_1} + {Summary.ChargeWeight_2} + {Summary.ChargeWeight_3}
Placed in the Main Report, Report Footer. If I remove the last “+{Summary.ChargeWeight_3}” I get a result but not the desired one. This may be because of the NULL results?
Any help would be greatly appreciated.