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.

How can I count lines on groupfooter in DataItem trigger?