Added table sorting to end of term report.