Counting record on Groupfooter(Dataitem trigger)

Hello all,
I can count lines in the OnPostSection trigger of groupfooter. But I have to transfer it into DataItem trigger. because I need convert into RDLC report. I tried this issue. but it is counting all records.
DataItem-OnAfterGetRecord()
line:=line+1;

How can I count lines on groupfooter in DataItem trigger?