for (final CurricularCourse curricularCourse : curricularCourses) { if (studentCurricularPlan.isCurricularCourseApproved(curricularCourse)) { final String grade = findGradeForCurricularCourse(student, curricularCourse); if (grade != null) { row.setCell(grade);
if (studentCurricularPlan.getDegreeCurricularPlan() == degreeCurricularPlan) { final Row row = spreadsheet.addRow(); row.setCell(student.getNumber().toString()); for (final CurricularCourse curricularCourse : curricularCourses) { if (studentCurricularPlan.isCurricularCourseApproved(curricularCourse)) { final String grade = findGradeForCurricularCourse(student, curricularCourse); if (grade != null) { row.setCell(grade); } else { row.setCell("AP"); }
	private void fillStudentsSpreadSheet(final ExecutionDegree executionDegree, final Spreadsheet spreadsheet) {		final DegreeCurricularPlan degreeCurricularPlan = executionDegree.getDegreeCurricularPlan();		final ExecutionYear executionYear = executionDegree.getExecutionYear();		final Scheduleing scheduleing = executionDegree.getScheduling();		final Integer maximumCurricularYearToCountCompletedCourses = scheduleing.getMaximumCurricularYearToCountCompletedCourses();		spreadsheet.setHeader("Aluno");		final List<CurricularCourse> curricularCourses = new ArrayList<CurricularCourse>();		for (final CurricularCourse curricularCourse : degreeCurricularPlan.getCurricularCoursesSet()) {			final Set<CurricularCourseScope> curricularCourseScopes = curricularCourse.getActiveScopesInExecutionYear(executionYear);			for (final CurricularCourseScope curricularCourseScope : curricularCourseScopes) {				if (maximumCurricularYearToCountCompletedCourses != null) {					if (curricularCourseScope.getCurricularSemester().getCurricularYear().getYear().intValue() <= maximumCurricularYearToCountCompletedCourses.intValue()) {						curricularCourses.add(curricularCourse);						spreadsheet.setHeader(curricularCourse.getName());					}				} else {					curricularCourses.add(curricularCourse);					spreadsheet.setHeader(curricularCourse.getName());									}			}		}		final SortedSet<Student> students = new TreeSet<Student>(Student.NUMBER_COMPARATOR);		for (final ExecutionDegree otherExecutionDegree : scheduleing.getExecutionDegreesSet()) {			for (final Group group : executionDegree.getAssociatedFinalDegreeWorkGroupsSet()) {				if (!group.getGroupProposalsSet().isEmpty()) {					for (final GroupStudent groupStudent : group.getGroupStudentsSet()) {						final Student student = groupStudent.getStudent();						final Row row = spreadsheet.addRow();						row.setCell(student.getNumber().toString());						final StudentCurricularPlan studentCurricularPlan = student.getActiveOrConcludedStudentCurricularPlan();						for (final CurricularCourse curricularCourse : curricularCourses) {							if (studentCurricularPlan.isCurricularCourseApproved(curricularCourse)) {								final String grade = findGradeForCurricularCourse(student, curricularCourse);								if (grade != null) {									row.setCell(grade);								} else {									row.setCell("AP");								}							} else {								row.setCell("");							}						}					}				}			}		}	}