My report summarizes many records per EmployeeID. Certain fields are simply Summarized while others a calculation is performed via a Formula in the Group Footer.
Details @SumHours_ALL
Details @SumHours_ALL
Details... @SumHours_ALL
Group Footer #3 @CalculateDays @SumDays
Details @SumHours_ALL
Details @SumHours_ALL
Details... @SumHours_ALL
Group Footer #3 @CalculateDays @SumDays
Group Footer #1 <Want to summarize @CalculateDays here>
Now we need to add a Summary of @DaysCalculate in Group Footer #1 but goto Insert/Summary and @DaysCalculate is not avaiable to Sum.
I'm found thread thread767-1402814 Summary on a Formula as a guide but it doesn't want to Sum all Formulas in GF#3, it only displays the last.
@CalculateDays
Global NumberVar gCalculateDays;
WhilePrintingRecords;
gCalculateDays = ({@SumHours_ALL}/ToNumber({SPROC;1.HrsPerDay}));
@SumDays
WhilePrintingRecords;
global NumberVar gCalculateDays := gCalculateDays;
@TotalDays
WhilePrintingRecords;
global NumberVar gCalculateDays := {@SumDays} ;
or
global NumberVar gCalculateDays := gCalculateDays;
(Same result)
@ResetTotalDays
WhilePrintingRecords;
global NumberVar gCalculateDays := 0;
I tried @ResetTotalDays in GF #1, GF #2 with no difference.
@CalculateDays, @SumDays work fine.
Tried @SumDays and @TotalDays in GF3, GF2 and GF1 with no difference. All different scenarios I can think of were tried but without any luck.
Anyone have any ideas? It's gotta be simpler than this to summarize fields
Why are some Formulas available to Summarize but not all?
So I try and create a Formula in Group Footer #1 ...
Sum ({@DaysCalculate},{SPROC;1.Tier} );
and get a 'Field Cannot be summarized' error
Usually if I want a summary in GF #1, I would summarize all Detail fields within GF#1 completely bypassing the Formulas in GF#3 because they're simply database field and can be summarized.
Summing formulas via the Sum() function doesn't work so am at a standstill
So I tried setting a Global Variable in @DaysCalculate but cannot pass it into another formula even as a test.
Formula @DaysCalculate
WhilePrintingRecords;
Global NumberVar gCalculateDays;
gCalculateDays := 99;
Formula @SumDays
WhileReadingRecords;
NumberVar gCalculateDay;
gCalculateDays := gCalculateDays + 1;
Formula @SumDays doesn't reflect Global Variable gCalculateDays
CR help is vague with explaining Global Variables.
They give this example...
//Formula C
Global NumberVar x;
x := 10;
//Formula D
//Call the function WhileReadingRecords
WhileReadingRecords;
Global NumberVar x;
x := x + 1
I put these in a Blank Report in the Report Header and Detail Section respectively. But it doesn't work as expected.
Formula D returns nothing, C has 10
Details @SumHours_ALL
Details @SumHours_ALL
Details... @SumHours_ALL
Group Footer #3 @CalculateDays @SumDays
Details @SumHours_ALL
Details @SumHours_ALL
Details... @SumHours_ALL
Group Footer #3 @CalculateDays @SumDays
Group Footer #1 <Want to summarize @CalculateDays here>
Now we need to add a Summary of @DaysCalculate in Group Footer #1 but goto Insert/Summary and @DaysCalculate is not avaiable to Sum.
I'm found thread thread767-1402814 Summary on a Formula as a guide but it doesn't want to Sum all Formulas in GF#3, it only displays the last.
@CalculateDays
Global NumberVar gCalculateDays;
WhilePrintingRecords;
gCalculateDays = ({@SumHours_ALL}/ToNumber({SPROC;1.HrsPerDay}));
@SumDays
WhilePrintingRecords;
global NumberVar gCalculateDays := gCalculateDays;
@TotalDays
WhilePrintingRecords;
global NumberVar gCalculateDays := {@SumDays} ;
or
global NumberVar gCalculateDays := gCalculateDays;
(Same result)
@ResetTotalDays
WhilePrintingRecords;
global NumberVar gCalculateDays := 0;
I tried @ResetTotalDays in GF #1, GF #2 with no difference.
@CalculateDays, @SumDays work fine.
Tried @SumDays and @TotalDays in GF3, GF2 and GF1 with no difference. All different scenarios I can think of were tried but without any luck.
Anyone have any ideas? It's gotta be simpler than this to summarize fields
Why are some Formulas available to Summarize but not all?
So I try and create a Formula in Group Footer #1 ...
Sum ({@DaysCalculate},{SPROC;1.Tier} );
and get a 'Field Cannot be summarized' error
Usually if I want a summary in GF #1, I would summarize all Detail fields within GF#1 completely bypassing the Formulas in GF#3 because they're simply database field and can be summarized.
Summing formulas via the Sum() function doesn't work so am at a standstill
So I tried setting a Global Variable in @DaysCalculate but cannot pass it into another formula even as a test.
Formula @DaysCalculate
WhilePrintingRecords;
Global NumberVar gCalculateDays;
gCalculateDays := 99;
Formula @SumDays
WhileReadingRecords;
NumberVar gCalculateDay;
gCalculateDays := gCalculateDays + 1;
Formula @SumDays doesn't reflect Global Variable gCalculateDays
CR help is vague with explaining Global Variables.
They give this example...
//Formula C
Global NumberVar x;
x := 10;
//Formula D
//Call the function WhileReadingRecords
WhileReadingRecords;
Global NumberVar x;
x := x + 1
I put these in a Blank Report in the Report Header and Detail Section respectively. But it doesn't work as expected.
Formula D returns nothing, C has 10