Sunday, March 25, 2012

crystal reports row count

bebe lush posted at 20-Sep-06 05:58
How can i add a column in the report to count the rows, and to auto increment.
Like:
1. | line 1
2. | line 2
3. |
to show me the current number.Friend,

Do one thing create one Formula Field named @.SlNo, and insert into detail section. Formula is given below:

//------------------

numberVar numSlno = 0;

IF PREVIOUSISNULL(<Name of Any Field>) THEN
numSlno := 1
ELSE
numSlno := numSlno + 1

//------------------|||why use formula
just include record number itself :wave:|||why use formula
just include record number itself :wave:
Thats correct way|||I tried this one but I got error at the part (<Name of Any Field>). I am a newbie, could you please elaborate on it? Thanks a lot!

Friend,

Do one thing create one Formula Field named @.SlNo, and insert into detail section. Formula is given below:

//------------------

numberVar numSlno = 0;

IF PREVIOUSISNULL(<Name of Any Field>) THEN
numSlno := 1
ELSE
numSlno := numSlno + 1

//------------------|||Well, that code has a bug anyway.
As said before, in the Field Explorer, just use the special field Record Number.|||as one of the repliers said,
the best way to me is to add a special field recordNumber.
OR you can also use a running total field.
In fields Explorer, Create new Running Total Field, Choose any of the fields (Preferably numeric) Summerize.
and select Count .
Allow it to execute for Each Record
One of these things should solve the problem.
The Last Solution i would suggest will be to use shared variables.|||as one of the repliers said,
the best way to me is to add a special field recordNumber.
OR you can also use a running total field.
In fields Explorer, Create new Running Total Field, Choose any of the fields (Preferably numeric) Summerize.
and select Count .
Allow it to execute for Each Record
One of these things should solve the problem.
The Last Solution i would suggest will be to use shared variables.

Why to make things complicated?

Just use Record Number field.

No comments:

Post a Comment