At present the code for export assumes that tghe column names will stay the same, it would be useful if the column names were derived from the sql.
(I can see an obvious issue in that at present the format is carried in the code, but maybe this coudl also be passed to the sql event so we can return an array with the new formats?)