Fixing sorting on reports

fixes both the fact that sorting wasn't working and also the fact that it was not sorting dates correctly.