for (final SummariesControlElementDTO summariesControlElementDTO : allListElements) { final Row row = spreadsheet.addRow(); row.setCell(summariesControlElementDTO.getTeacherName()); row.setCell(summariesControlElementDTO.getTeacherNumber().toString()); row.setCell(summariesControlElementDTO.getCategoryName()); row.setCell(summariesControlElementDTO.getExecutionCourseName()); row.setCell(summariesControlElementDTO.getLessonHours().toString()); row.setCell(summariesControlElementDTO.getSummaryHours().toString()); row.setCell(summariesControlElementDTO.getShiftDifference().toString()); row.setCell(summariesControlElementDTO.getCourseSummaryHours().toString()); row.setCell(summariesControlElementDTO.getCourseDifference().toString()); }
fillSpreadSheet(allListElements, spreadsheet);
    private void exportToXls(final List<SummariesControlElementDTO> allListElements, OutputStream outputStream) throws IOException {                        final List<String> headers = getHeaders();        final Spreadsheet spreadsheet = new Spreadsheet("Controlo de Sumrios", headers);                for (final SummariesControlElementDTO summariesControlElementDTO : allListElements) {            final Row row = spreadsheet.addRow();            row.setCell(summariesControlElementDTO.getTeacherName());            row.setCell(summariesControlElementDTO.getTeacherNumber().toString());            row.setCell(summariesControlElementDTO.getCategoryName());            row.setCell(summariesControlElementDTO.getExecutionCourseName());            row.setCell(summariesControlElementDTO.getLessonHours().toString());            row.setCell(summariesControlElementDTO.getSummaryHours().toString());            row.setCell(summariesControlElementDTO.getShiftDifference().toString());            row.setCell(summariesControlElementDTO.getCourseSummaryHours().toString());            row.setCell(summariesControlElementDTO.getCourseDifference().toString());                               }        spreadsheet.exportToXLSSheet(outputStream);    }