Maybe this will work for you: Present the data you want to export on a page in a datagrid having a datasource other then Datasource and add a button “Export to Excel”.
If not, the first suspect is that the mechanism is not working at all. Do you get the error with another testobject as well. Try a new entity having one string-attirbute, one object and a simple value.
If that works, then have a look at the data that you are trying to export. Does it have breaking tokens like a double quote?
What is the log (or locally the console) saying when this error occurs?
Also, I don’t really understand what the association between file and Purchases is doing. You retrieve a List of purchases and you do something with your file, but your file can always only point to one purchase.
If you want to use excel exporter and create the list of objects you want to export in a microflow, you need a wrapper entity that is associated with this list (*-1 with the purchase as parent or *-*). In your template configuration you can now use this wrapper object as input object and your purchase as row object.
I hope that helps.