Get the data currently being viewed

Hi,
I have to export the data that currently being viewed in grid.

I have #text_filters for my columns.
when i typed something in those filters the data will be filtered in grid and only the rows which satisfies the filter text are showed.

Then how can i get only rows from grid?

If i use forEachRow method i am getting all the rows which are not currently rendered also.

Please help me.

Thanks in advance.

You may try to use the alternative method forEachRowA().