Report to write the data to file is not getting executed

(imported topic written by Bhushan Chirmade)

We are trying to create a report which runs relevance to get the data and then write that data to the file. At this moment we have only added the code to write a file however this code is not getting executed. Whenever we click on the report it goes into edit mode and shows the code.

We would like to schedule this report to generate the data in the file and then upload that file to FTP server. Any help would be highly appreciated.

Code: