In our daily usage of forms, its a requirement that we dump the records from grid in the form to any specified file format. The sample project that i have created will help dump these records (takes care of the filterings that you might have applied to the form). The project can be found on the following link http://www.axaptapedia.com/Image:Export_CSV.xpo
The code basically gets the records from the form’s datasource and sends them to a CSV file. An option of sending the generated file as an attachement in the email is also provided.