String deptName = department.getRealName();
String deptName = department.getName();
    private void exportToXls(Map<Department, Map<Unit, List>> teachersCreditsByDepartment,            ServletOutputStream outputStream) throws IOException {        final Spreadsheet spreadsheet = new Spreadsheet("Relatrio de Crditos");        final HSSFWorkbook workbook = new HSSFWorkbook();        final ExcelStyle excelStyle = new ExcelStyle(workbook);        for (Department department : teachersCreditsByDepartment.keySet()) {            Set<ExecutionPeriod> executionPeriods = null;            String deptName = department.getRealName();            deptName = deptName.replaceAll("DEPARTAMENTO", "DEP. ");            deptName = deptName.replaceAll("ENGENHARIA", "ENG. ");            spreadsheet.setName(deptName);                                  Map<Unit, List> creditsByUnit = teachersCreditsByDepartment.get(department);            Double unitTotalCredits = 0.0;            for (Unit unit : creditsByUnit.keySet()) {                List<TeacherCreditsReportDTO> teachersCreditReportDTOs = creditsByUnit.get(unit);                if (executionPeriods == null) {                    executionPeriods = teachersCreditReportDTOs.get(0).getCreditsByExecutionPeriod()                            .keySet();                }                spreadsheet.addRow();                final Row row = spreadsheet.addRow();                row.setCell(unit.getName());                setHeaders(executionPeriods, spreadsheet);                unitTotalCredits += fillSpreadSheet(teachersCreditReportDTOs, spreadsheet);            }            spreadsheet.exportToXLSSheet(workbook, excelStyle.getHeaderStyle(), excelStyle                    .getStringStyle());            spreadsheet.setRows(new ArrayList<Row>());        }        workbook.write(outputStream);    }