return (o1.getUser().getFullname()).compareTo(o2.getUser().getFullname());
}
});
}
final ExportWorkbook xls = new ExportWorkbook();
final ContentProvider contentProvider = new MyContentProvider(xls);
// create a default Date format and currency column
xls.setContentProvider(contentProvider);
final EmployeeSalaryDO first = list.get(0);
final int year = first.getYear();
final int month = first.getMonth();
final DayHolder buchungsdatum = new DayHolder();
buchungsdatum.setDate(year, month, 1);
final MonthHolder monthHolder = new MonthHolder(buchungsdatum.getDate());
final BigDecimal numberOfWorkingDays = monthHolder.getNumberOfWorkingDays();
buchungsdatum.setEndOfMonth();
final String sheetTitle = DateHelper.formatMonth(year, month);
final ExportSheet sheet = xls.addSheet(sheetTitle);
sheet.createFreezePane(0, 1);
final ExportSheet employeeSheet = xls.addSheet(PFUserContext.getLocalizedString("fibu.employee"));
employeeSheet.setColumnWidth(0, MyXlsContentProvider.LENGTH_USER * 256);
employeeSheet.setColumnWidth(1, 14 * 256);
employeeSheet.setColumnWidth(2, 12 * 256);
employeeSheet.setColumnWidth(3, 12 * 256);
employeeSheet.setColumnWidth(4, 12 * 256);
final ContentProvider provider = employeeSheet.getContentProvider();
provider.putFormat("STUNDEN", "0.00;[Red]-0.00");
final ExportRow employeeRow = employeeSheet.addRow();
employeeRow.addCell(0, PFUserContext.getLocalizedString("fibu.employee"));
employeeRow.addCell(1, PFUserContext.getLocalizedString("fibu.employee.wochenstunden"));
employeeRow.addCell(2, PFUserContext.getLocalizedString("fibu.employee.sollstunden"));
employeeRow.addCell(3, PFUserContext.getLocalizedString("fibu.employee.iststunden"));
employeeRow.addCell(4, PFUserContext.getLocalizedString("fibu.common.difference"));
// build all column names, title, widths from fixed and variable columns
final int numCols = ExcelColumn.values().length;
final String[] colNames = new String[numCols];
final String[] colTitles = new String[numCols];
final int[] colWidths = new int[numCols];
int idx = 0;
for (final ExcelColumn col : EnumSet.range(ExcelColumn.START, ExcelColumn.END)) {
colNames[idx] = col.name();
colTitles[idx] = PFUserContext.getLocalizedString(col.theTitle);
colWidths[idx] = col.width;
++idx;
}
// column property names
sheet.setPropertyNames(colNames);
final ContentProvider sheetProvider = sheet.getContentProvider();
sheetProvider.putFormat("STUNDEN", "0.00");
sheetProvider.putFormat("BRUTTO_MIT_AG", "#,##0.00;[Red]-#,##0.00");
sheetProvider.putFormat("KORREKTUR", "#,##0.00;[Red]-#,##0.00");
sheetProvider.putFormat("SUMME", "#,##0.00;[Red]-#,##0.00");
sheetProvider.putFormat("KOST1", "#");
sheetProvider.putFormat("KOST2", "#");
sheetProvider.putFormat("KONTO", "#");
sheetProvider.putFormat("GEGENKONTO", "#");
sheetProvider.putFormat("DATUM", "dd.MM.yyyy");
// inform provider of column widths
for (int ci = 0; ci < colWidths.length; ++ci) {
sheetProvider.putColWidth(ci, colWidths[ci]);
}
final ExportRow headRow = sheet.addRow();
int i = 0;
for (final String title : colTitles) {