The textReportDriver.closeFile() function closes the driver file that contains report information.
textReport.textReportDriver.closeFile()
In the following example, the report engine closes the driver file that it created from a scratch file:
myReportDriver = TextReportDriver.createDriverFromTempFile();
myReport.setReportDriver(myReportDriver);
...
myReport.myReportDriver.closeFile();