Loop a viewstack

Flex newbie here, stuck on what should be a simple task.

My application consists of a viewStack of 10 panels. Each panel have a datagrid. I would like to print all 10 datagrids content in Excel file.
My problem is, I don’t know how to loop a datagrid in order to have all printed in Excel.
Currently it only print one datagrid(by using viewstack - selected index).
Please help…:sen:

thanks in advance.