>
>Can you give an example?
>
>Thanks.
>
OK,
Create a program called LineCnt.prg
IF TYPE('gnCount') <> 'N'
PUBLIC gnCount
gnCount = 1
ELSE
gnCount = gnCount + 1
ENDIF
RETURN SPACE(0)
Create a program called ResetCnt.prg
IF TYPE('gnCount') <> 'N'
PUBLIC gnCount
ENDIF
gnCount = 0
RETURN SPACE(0)
In your report, in the page header add a field with the expression
ResetCnt()
In the detail band of the report, add a field with the expression
LineCnt()
Also in the detail band, add a field containing the data that you want to print, say only on line 20. Click on the 'PrintWhen' option for this field, then 'Print only when expression is true'. Add the following expression:
TYPE('gnCount') = 'N' AND gnCount = 20
I've used a lot of TYPE checking just as a safeguard.
When your report is finished, you should also
RELEASE gnCount