SBendBuckeye
Programmer
Hello,
I have a report that prints identical information but is sorted very differently based on the final recipient. To avoid multiple reports, I have defined a variable named SortKey and set it based on the ReportOption parm the user enters. That part is working just fine.
I have multiple groups and depending on the ReportOption they may or may not need to print so I am using Formula suppression. This is also working OK.
The problem comes when I need to print subtotals. Say for ReportOption 1 I need to print a subtotal for Group4 but ignore the changes for Group3. Because every Group3 break will trigger a Group4 break, I am using Global Numbervars defined as follows:
In the Detail Line:
Global NumberVar AccumTotal;
If RecordNumber = 1 Then AccumTotal := 0;
AccumTotal := AccumTotal + FieldValue;
Group4 Conditional Suppression:
WhilePrintingRecords;
Previous(Group4FieldName) = Group4NameFieldName
In Group4 Header:
Global NumberVar AccumTotal;
Local NumberVar locAccumTotal;
locAccumTotal := AccumTotal; // Save value for printing
AccumTotal := 0; // Reset accumulator
locAccumTotal // Print accumulated total
The problem is that it always prints 0 in the Group4 header. I know AccumTotal is accumulating properly because I am printing it in the detail line for testing purposes and it keeps right on going and is not reset. This is true even though the Group4 header prints where I would expect it to.
I haven't had to do anything like this for a while. Am I missing something obvious here? Thanks!
Have a great day!
j2consulting@yahoo.com
I have a report that prints identical information but is sorted very differently based on the final recipient. To avoid multiple reports, I have defined a variable named SortKey and set it based on the ReportOption parm the user enters. That part is working just fine.
I have multiple groups and depending on the ReportOption they may or may not need to print so I am using Formula suppression. This is also working OK.
The problem comes when I need to print subtotals. Say for ReportOption 1 I need to print a subtotal for Group4 but ignore the changes for Group3. Because every Group3 break will trigger a Group4 break, I am using Global Numbervars defined as follows:
In the Detail Line:
Global NumberVar AccumTotal;
If RecordNumber = 1 Then AccumTotal := 0;
AccumTotal := AccumTotal + FieldValue;
Group4 Conditional Suppression:
WhilePrintingRecords;
Previous(Group4FieldName) = Group4NameFieldName
In Group4 Header:
Global NumberVar AccumTotal;
Local NumberVar locAccumTotal;
locAccumTotal := AccumTotal; // Save value for printing
AccumTotal := 0; // Reset accumulator
locAccumTotal // Print accumulated total
The problem is that it always prints 0 in the Group4 header. I know AccumTotal is accumulating properly because I am printing it in the detail line for testing purposes and it keeps right on going and is not reset. This is true even though the Group4 header prints where I would expect it to.
I haven't had to do anything like this for a while. Am I missing something obvious here? Thanks!
Have a great day!
j2consulting@yahoo.com