for (final OutboundMobilityCandidacySubmission submission : getOutboundMobilityCandidacySubmissionSet()) {
final OutboundMobilityCandidacy candidacy = submission.getSelectedCandidacy();
if (candidacy != null) {
final Registration registration = submission.getRegistration();
final Person person = registration.getPerson();
final ICurriculum curriculum = registration.getCurriculum();
final OutboundMobilityCandidacyContest contest = candidacy.getOutboundMobilityCandidacyContest();
final OutboundMobilityCandidacyContestGroup group = contest.getOutboundMobilityCandidacyContestGroup();
final MobilityAgreement mobilityAgreement = contest.getMobilityAgreement();
final MobilityProgram mobilityProgram = mobilityAgreement.getMobilityProgram();
final RegistrationProtocol registrationProtocol = mobilityProgram.getRegistrationProtocol();
final UniversityUnit universityUnit = mobilityAgreement.getUniversityUnit();
final Country country = universityUnit.getCountry();
final Row candidacyRow = spreadsheetCandidates.addRow();
candidacyRow.setCell(getString("label.mobility.program"), registrationProtocol.getDescription().getContent());
candidacyRow.setCell(getString("label.country"), country == null ? "" : country.getLocalizedName().toString());
candidacyRow.setCell(getString("label.university"), universityUnit.getPresentationName());
candidacyRow.setCell(getString("label.degrees"), group.getDescription());
candidacyRow.setCell(getString("label.vacancies"), contest.getVacancies());
candidacyRow.setCell(getString("label.username"), person.getUsername());
candidacyRow.setCell(getString("label.name"), person.getName());
candidacyRow.setCell(getString("label.degree"), registration.getDegree().getSigla());
candidacyRow.setCell(getString("label.candidate.classification"), getGrades(submission));
candidacyRow.setCell(getString("label.preference.order"), candidacy.getPreferenceOrder());
candidacyRow.setCell(getString("label.curricular.year"), curriculum.getCurricularYear());
candidacyRow.setCell(getString("label.ects.completed.degree"), curriculum.getSumEctsCredits().toString());
candidacyRow.setCell(getString("label.average.degree"), curriculum.getAverage().toString());
group.fillCycleDetails(candidacyRow, CycleType.FIRST_CYCLE, registration,
getString("label.ects.completed.cycle.first"), getString("label.average.cycle.first"));
group.fillCycleDetails(candidacyRow, CycleType.SECOND_CYCLE, registration,
getString("label.ects.completed.cycle.second"), getString("label.average.cycle.second"));
candidacyRow.setCell(getString("label.email"), person.getEmailForSendingEmails());
candidacyRow.setCell(getString("label.phone"), person.getDefaultPhoneNumber());
candidacyRow.setCell(getString("label.mobile"), person.getDefaultMobilePhoneNumber());
for (final Registration otherRegistration : registration.getStudent().getRegistrationsSet()) {
if (otherRegistration != registration) {
final Row rowOCI = spreadsheetOtherCurricularInfo.addRow();
final ICurriculum curriculumOther = otherRegistration.getCurriculum();
rowOCI.setCell(getString("label.username"), person.getUsername());
rowOCI.setCell(getString("label.name"), person.getName());
rowOCI.setCell(getString("label.degree"), otherRegistration.getDegree().getSigla());
rowOCI.setCell(getString("label.curricular.year"), curriculumOther.getCurricularYear());
rowOCI.setCell(getString("label.ects.completed.degree"), curriculumOther.getSumEctsCredits().toString());
rowOCI.setCell(getString("label.average.degree"), curriculumOther.getAverage().toString());
group.fillCycleDetails(rowOCI, CycleType.FIRST_CYCLE, otherRegistration,
getString("label.ects.completed.cycle.first"), getString("label.average.cycle.first"));
group.fillCycleDetails(rowOCI, CycleType.SECOND_CYCLE, otherRegistration,
getString("label.ects.completed.cycle.second"), getString("label.average.cycle.second"));
}