Create a model for LeaveReport, and move 'most' of the code over there as this code is not really controller logic, but business logic instead.