").append(LINE_SEPARATOR);
+ html.append(" ")
+ .append(LINE_SEPARATOR);
+ html.append("
PAGE ").append(page).append("
")
+ .append(LINE_SEPARATOR);
+ html.append("
").append(LINE_SEPARATOR);
+ html.append(" | Student ID | Student Name | Major | Courses |
")
+ .append(LINE_SEPARATOR);
+
+ int detailsOnPage = LAST_DETAIL_LINE - FIRST_DETAIL_LINE + 1;
+ for (int i = 0; i < detailsOnPage && recordIndex < records.size(); i++) {
+ ReportRecord record = records.get(recordIndex++);
+ html.append(" ");
+ html.append("| ").append(String.format("%06d", record.getStudentId())).append(" | ");
+ html.append("").append(escapeHtml(record.getStudentName())).append(" | ");
+ html.append("").append(escapeHtml(record.getMajor())).append(" | ");
+ html.append("").append(String.format("%02d", record.getNumCourses())).append(" | ");
+ html.append("
").append(LINE_SEPARATOR);
+ }
+
+ html.append("
").append(LINE_SEPARATOR);
+ html.append("
").append(LINE_SEPARATOR);
+
+ if (page < totalPages) {
+ html.append("