Originally posted by viperbyte
I have this in a formula and I have this formula inserted into GroupHeader A:
NUMBERVAR COUNTER;
COUNTER:= COUNTER + 1
NUMBERVAR COUNTER;
Why do you have the second "NUMBERVAR COUNTER;" in here? I suspect that the real problem is that you're never initializing the variable to 0, so it's value is really "null". When you add something to null, you still get null!
So, you'll need two or three formulas - one that will initialize the variable to 0, one that will increment it, and one that will display it. They'll look like this:
{@InitCounter}
WhileReadingRecords;
NumberVar COUNTER := 0;
Place this in the Report header section to initialize it at the beginning of the report. (even if the report header is suppressed, the variable will be initialized. Because of the semi-colon at the end, the value won't actuall appear on the report.
{@AddCounter}
WhileReadingRecords;
NumberVar COUNTER;
COUNTER := COUNTER + 1;
Place this in your group header. If you want the value to appear on the report, take the semi-colon off the end.
{@ShowCounter}
WhileReadingRecords;
NumberVar COUNTER
If you want to show the value of the of the variable in a section other than where it's being incremented, create this third formula to show it.
-Dell