Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: increment number problem Post Reply Post New Topic
Author Message
awakendream
Newbie
Newbie


Joined: 23 Mar 2009
Online Status: Offline
Posts: 7
Quote awakendream Replybullet Topic: increment number problem
     Posted: 26 Mar 2009 at 7:25am
Hi All,
I have a very simple problem... have tried to search in this forum but can't find...  I want to create a sequence number that start from 0 for each records in details section and reset back to 0 again in every group... how should i write a formula to get the result?
Last time i was managed to do this, but already few days trying this simple things still can't find the answer.. anyone can advise pls.. Thanks!!
 example:

No   Name
 0     abc
 1     fee
 2     nvi
 3     dee
 4     tio
 5     mio

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 26 Mar 2009 at 1:14pm
You want to use a Running Total.
 
1. Create a new running total.
2. Select a field that is unique for each name.
3. Type of summary is "Count".
4. Evaluate for each record.
5. Reset on change of group - select the group where you want it to reset.
 
-Dell
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Mar 2009 at 6:31am
Wouldn't this cause the report to start at 1, not 0?
 
I would have used formula to set a shared variable to -1 in the group and then to increment by 1 in each detail line, but then again, I never use running totals...just gotten used to using formulas.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 28 Mar 2009 at 5:31am

Try this:  Start with the running total.  Use it in a formula - {@MyRecordCount} -1.  Put the formula on the report.

-Dell

IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum