/** * Gets the format string for the logged-in user. Uses the date format of the logged in user and if not given, a default format is * returned. * * @param format * @see Configuration#getExcelDateFormats() * @see PFUserDO#getExcelDateFormat() */ public static String getExcelFormatString(final ExportContext exportContext, final DateFormatType format) { return getExcelFormatString(exportContext.getExcelDateFormat(), format); }
public XlsContentProvider(final ExportContext exportContext, final ExportWorkbook workbook) { this.exportContext = exportContext; this.workbook = workbook; createFonts(); defaultFormatMap.put(Integer.class, new CellFormat("#,##0", CellStyle.ALIGN_RIGHT)); defaultFormatMap.put(Number.class, new CellFormat("#,###.######", CellStyle.ALIGN_RIGHT)); defaultFormatMap .put(Date.class, new CellFormat(ExcelDateFormats.getExcelFormatString(exportContext, DateFormatType.DATE_TIME_MINUTES))); defaultFormatMap.put(java.sql.Date.class, new CellFormat(ExcelDateFormats.getExcelFormatString(exportContext, DateFormatType.DATE))); defaultFormatMap.put(java.sql.Timestamp.class, new CellFormat(ExcelDateFormats.getExcelFormatString(exportContext, DateFormatType.DATE_TIME_MILLIS))); }