You can make a report that will act like a .CSV file and it can be exported through a DATA EXPORT
Here is an example of one I found on the forum.
[Sales:1,1,1]
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:,}
{REPORT ORDER DETAILS:
O.ItemGroup,
O.MenuItemName,
O.Quantity.Sum.desc,
O.ExactTotal.Sum.desc
:(ODI=True) and O.MenuItemName="$1"
:"{0}";"{1}";{2};{3}}
Also note I use semicolon instead of commas it just a personal preference.