sheetProvider.putFormat(MyXlsContentProvider.FORMAT_CURRENCY, OrderCol.NETSUM, OrderCol.INVOICED, OrderCol.TO_BE_INVOICED);
sheetProvider.putFormat(DateFormats.getExcelFormatString(DateFormatType.DATE), OrderCol.DATE, OrderCol.ORDER_DATE);
sheet.createFreezePane(1, 1);
sheet.setColumns(columns);
for (final AuftragDO order : list) {
final PropertyMapping mapping = new PropertyMapping();
addOrderMapping(mapping, order, params);
sheet.addRow(mapping.getMapping(), 0);
}
sheet.setAutoFilter();
columns = createPosColumns();
sheetTitle = PFUserContext.getLocalizedString("fibu.auftrag.positions");
sheet = xls.addSheet(sheetTitle);
sheetProvider = sheet.getContentProvider();
sheetProvider.putFormat(MyXlsContentProvider.FORMAT_CURRENCY, PosCol.NETSUM, PosCol.INVOICED, PosCol.TO_BE_INVOICED);
sheetProvider.putFormat(DateFormats.getExcelFormatString(DateFormatType.DATE), PosCol.DATE, PosCol.PERIOD_OF_PERFORMANCE_BEGIN,
PosCol.PERIOD_OF_PERFORMANCE_END);
sheet.createFreezePane(1, 1);
sheet.setColumns(columns);
sheet.setMergedRegion(0, 0, PosCol.PERIOD_OF_PERFORMANCE_BEGIN.ordinal(), PosCol.PERIOD_OF_PERFORMANCE_END.ordinal(),
PFUserContext.getLocalizedString("fibu.periodOfPerformance"));
for (final AuftragDO order : list) {
if (order.getPositionen() == null) {
continue;
}
for (final AuftragsPositionDO pos : order.getPositionen()) {
final PropertyMapping mapping = new PropertyMapping();
addPosMapping(mapping, order, pos, params);
sheet.addRow(mapping.getMapping(), 0);
}
}
sheet.setAutoFilter();
return xls.getAsByteArray();
}