#643: DOListExcelExporter.java

projectforge-business/src/main/java/org/projectforge/export/DOListExcelExporter.java Lines: 85 · Type: Java — extends MyExcelExporter 85 lines · 34 code · 44 comments · 7 blank

Base class for all DO-list-based Excel exports. 85 lines. Extended by DOGetterListExcelExporter and virtually every entity-list export in the application (orders, invoices, employees, contacts, etc.). Described as "MyExcelExporter with minor optimizations for AbstractListPage" — this is the export layer for Wicket list pages.

Constructor — DOListExcelExporter(String filenameIdentifier): Generates a filename in the format "ProjectForge-{identifier}_{yyyymmdd}.xls". Uses DateHelper.getDateAsFilenameSuffix(new Date()) which returns a compact date string without separators. Default identifier: "export". The .xls extension is hardcoded — even though the actual format is XLSX (generated by POI's XSSFWorkbook), the extension was set before the XLSX transition and never updated. In practice, Excel and LibreOffice both open the file correctly regardless of extension.

Override — putFieldFormat(ContentProvider, Field, PropertyInfo, ExportColumn): Calls super.putFieldFormat() to apply standard formatting, then checks if the field name is "deleted" — if so, sets column width to 8 (narrow column for boolean checkbox display). This is an example of per-field customization in the export pipeline — each specific exporter can override this method to adjust column widths based on field semantics.

isExcelAutoFilter() — returns true: Activates Excel's auto-filter on the first row (the header row). When users open the exported file, each column header gets a dropdown filter arrow — they can filter data directly in Excel without needing ProjectForge's list page filters. This is a user-experience optimization that costs nothing to add and is enabled for all DO list exports.

onBeforeDownload() — empty hook: Subclasses can override to add extra sheets or data before the workbook is written. For example, an employee billing export might add a summary sheet with totals. Does nothing by default — follows the Template Method pattern for extension points.

Filename notes: Hardcoded ".xls" extension and prefix "ProjectForge-". The timestamp suffix ensures unique filenames — if a user exports twice on the same day, they get ProjectForge-employees_20250124.xls for both exports, potentially overwriting. The yyyyMMdd granularity means exports within the same day share the same filename — no time-of-day component.

#643: DOListExcelExporter.java

Lines: 85 · Type: Java — extends MyExcelExporter

Base class for all DO-list-based Excel exports. 85 lines. Extended by DOGetterListExcelExporter and virtually every entity-list export in the application (orders, invoices, employees, contacts, etc.). Described as "MyExcelExporter with minor optimizations for AbstractListPage" — this is the export layer for Wicket list pages.

Constructor — DOListExcelExporter(String filenameIdentifier): Generates a filename in the format "ProjectForge-{identifier}_{yyyymmdd}.xls". Uses DateHelper.getDateAsFilenameSuffix(new Date()) which returns a compact date string without separators. Default identifier: "export". The .xls extension is hardcoded — even though the actual format is XLSX (generated by POI's XSSFWorkbook), the extension was set before the XLSX transition and never updated. In practice, Excel and LibreOffice both open the file correctly regardless of extension.

Override — putFieldFormat(ContentProvider, Field, PropertyInfo, ExportColumn): Calls super.putFieldFormat() to apply standard formatting, then checks if the field name is "deleted" — if so, sets column width to 8 (narrow column for boolean checkbox display). This is an example of per-field customization in the export pipeline — each specific exporter can override this method to adjust column widths based on field semantics.

isExcelAutoFilter() — returns true: Activates Excel's auto-filter on the first row (the header row). When users open the exported file, each column header gets a dropdown filter arrow — they can filter data directly in Excel without needing ProjectForge's list page filters. This is a user-experience optimization that costs nothing to add and is enabled for all DO list exports.

onBeforeDownload() — empty hook: Subclasses can override to add extra sheets or data before the workbook is written. For example, an employee billing export might add a summary sheet with totals. Does nothing by default — follows the Template Method pattern for extension points.

Filename notes: Hardcoded ".xls" extension and prefix "ProjectForge-". The timestamp suffix ensures unique filenames — if a user exports twice on the same day, they get ProjectForge-employees_20250124.xls for both exports, potentially overwriting. The yyyyMMdd granularity means exports within the same day share the same filename — no time-of-day component.