Using file layout to export data
I have an app engine program that uses a file layout to export data to a csv file. That all works fine. The users have asked to have column headings added to the file.
Is there an easy way to get the field names from the file layout and export these to the first row prior to writing the first row of data to the csv file? I was thinking of somehow looping through either the record definition or the file layout definition grabbing the field names and stringing them together with a comma between each. I tried, but it is not working as expected. Has anyone done this? Can you provide some guidance?