Click to See Complete Forum and Search --> : Increment the serial number


pallavijyo
December 20th, 2004, 02:25 PM
I need to display the serial no in crystal reports 8.5
i wrote this formula

WhilePrintingRecords;
NumberVar mycounter:=0;

mycounter := mycounter + 1;

but still it displays 1 for each record.....i want it

1
2
3
4
5
6
so on

springsoft
December 20th, 2004, 09:09 PM
I'd use a RunningTotal.....
Menu - Insert
Menu - Field Object
Select RunningTotal from list of available types in Field Explorer dialog.
"Create Running Total Field" dialog should display.
Name it.
Select a field which occurs in each line of the details section or group that you want to count on, and put it into the Field to Summarize box.
Make the Type of Summary a Count.
Leave the rest of the options alone.
Click OK and then place the field on your report, in the repeated detail line or group.
Run it and you should see your counter increment for each element.

That's the basics. Then you can mess with these to do lots of cool stuff.

dave

Madhi
December 20th, 2004, 11:51 PM
Hi, try this
NumberVar mycounter
WhilePrintingRecords;
mycounter := mycounter + 1;

Madhivanan

pallavijyo
December 21st, 2004, 01:44 PM
Thks Dave ths was indeed helpful