Row Number in Group, For Each Group Row Number must start from 1

hi experts, i am using Crystal report 11,
i want to start Row Number for each group. e.g.  Cash and Credit there are two group having some data, I need  Below restult
1       ahmed ali
2       akbar ali
3       sarfraz ahmed
1      basit afzal
2      javid akram
3      Imran Khan

Note: i have written code  but my each row gives me 1  instead of 1, 2 ,3 .....
Please correct my code,  or give me other code to full fill my requirement.

In the report header
Name - DeclVars
global numbervar RecCount := 0;

In the group header
Name ResetCount
global numbervar RecCount;
RecCount := 0;

In the detail section
Name IncCount
global numbervar RecCount;
RecCount := RecCount + 1;
Who is Participating?
mlmccConnect With a Mentor Commented:
Crystal by default evaluates formulas as early in the process as possible.  However it only retains values for formulas in the Printing pass.  To forcec a formula to be evaluated in a particular pass you can add an evaluation time command to the formula

Add WhilePrintingRecords; as the first line of each formula.

global numbervar RecCount := 0;

mahmood66Author Commented:
Thanx a lot for your quick support dear,
same thing i have done using running Total and reset at group(i select Group Name from list).
anywho than againt.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.