The engine finishes by closing the output file.
textReport.finishReport()
The following example prints any output that is associated with the final row, prints a last footer, and closes the output file.
myReport TextReport = new TextReport();
...
myReport.finishReport();