Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to set record counter and reset after it reached certain number

Status
Not open for further replies.

crystalreport85

Programmer
Sep 27, 2010
51
CA
i am trying to add a field where is generate a sequence number. how to generate sequence number and when it reaches 80 it should reset to 0 and start from 1,2,3..
please help
Thank you
 
whilereadingrecords;
numbervar cnt;
if cnt < 80 then
cnt := cnt + 1 else
cnt := 1;

-LB
 
Thank you so much. I have one more question
On change of a 'field name' value the counter should reset to zero and start the counter.
 
befor start of the group you can create one reset forumla
as


@reset
------
whileprintingrecords
numbervar cnt := 0;



Thanks,
reacha
 
@reset
------
whileprintingrecords;
numbervar cnt := 0;

 
If you are doing it on change of a field, then you could just insert a running total and in the reset section select the field you want to cause the reset.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top