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) {
headRow.addCell(i++, title);
}
for (final EmployeeSalaryDO salary : list) {
final PropertyMapping mapping = new PropertyMapping();
final PFUserDO user = userGroupCache.getUser(salary.getEmployee().getUserId());