Following process steps are used to export instances from a BO using a query (Person_List_This_Year) and exporting the file using a template format defined in the export template "Attendee_List".
The first 2 steps cause the exported CSV file to be stored in a SystemSetting attribute. The final step displays the CSV file on a form with no buttons to the user can download the CSV file to a destination of their choosing.
Step 3 is used to mop up the files used as temporary storage during the process.
1) EXPORT 'Person_List_This_Year' TO 'c:/AwareIM_temp/RRexpoExport.csv' USING 'Attendee_List'
2) IMPORT DOCUMENT SystemSettings.Export_This_Year_Contacts FROM 'c:/AwareIM_temp/RRexpoExport.csv'
3) DELETE FILE 'c:/AwareIM_temp/RRexpoExport.csv'
4) VIEW SystemSettings USING Show_Export