spreadsheet.newRow();
spreadsheet.addCell(registrations.size() + " " + getResourceMessage("label.students"));
setHeaders(spreadsheet, detailed);
for (Enrolment registrationWithStateForExecutionYearBean : registrations) {
Registration registration = registrationWithStateForExecutionYearBean.getRegistration();
spreadsheet.newRow();
spreadsheet.addCell(registration.getNumber().toString());
spreadsheet.addCell(registration.getPerson().getName());
spreadsheet.addCell(registration.getRegistrationProtocol().getCode());
Degree degree = registration.getDegree();
spreadsheet.addCell(!(StringUtils.isEmpty(degree.getSigla())) ? degree.getSigla() : degree.getNameFor(executionYear)
.toString());
spreadsheet.addCell(registrationWithStateForExecutionYearBean.getEnrollmentState().getDescription());
spreadsheet.addCell(registrationWithStateForExecutionYearBean.getEnrolmentEvaluationType().getDescription());
if (detailed) {
spreadsheet.addCell(registration.getPerson().hasDefaultEmailAddress() ? registration.getPerson()
.getDefaultEmailAddressValue() : "-");
spreadsheet.addCell(registration.getPerson().hasInstitutionalEmailAddress() ? registration.getPerson()
.getInstitutionalEmailAddressValue() : "-");
PartyContact mobileContact = getMobileContact(registration.getPerson());
spreadsheet.addCell(mobileContact != null ? mobileContact.getPresentationValue() : "-");
}
}