The existing code for reporting is incorrect and does not work. Need to restart this, working from the specification very carefully.