private void addHeadRowCell(final ExportRow headRow, final ExportColumn col, final String[] colNames, final int idx) { headRow.addCell(idx, col.getTitle()); colNames[idx] = col.getName(); contentProvider.putColWidth(idx, col.getWidth()); }
public void putFieldFormat(final ExportSheet sheet, final Field field, final PropertyInfo propInfo, final ExportColumn exportColumn) { putFieldFormat(sheet.getContentProvider(), field, propInfo, exportColumn); }
public void addRows(final Collection<?> rowBeans, final int startCol) { for (final Object rowBean : rowBeans) { addRow(rowBean, startCol); } }
public ExportSheet addSheet(final ContentProvider sheetProvider, final String sheetTitle) { final ExportSheet sheet = workBook.addSheet(sheetTitle); // create a default Date format and currency column sheet.setContentProvider(sheetProvider); return sheet; }
/** * @param name * @param i18nTitle The i18n key of the title. * @param width */ public I18nExportColumn(final String name, final String i18nTitle, final int width) { super(name, i18nTitle != null ? ExportConfig.getInstance().getDefaultExportContext().getLocalizedString(i18nTitle) : "", width); }
/** * Override this method for own {@link XlsContentProvider}. * * @param workbook * @return */ protected ContentProvider createNewContentProvider(ExportWorkbook workbook) { return new XlsContentProvider(getDefaultExportContext(), workbook); }
/** * 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 void updateStyles() { if (contentProvider != null) { contentProvider.updateSheetStyle(this); for (final ExportRow row : rows) { row.updateStyles(contentProvider); } } }
/** * @param value * @return this for chaining. */ public ExportCell setValue(final Object value) { return setValue(value, null); }
/** * @param cellFormat * @return this for chaining. */ public ExportCell setCellFormat(final String cellFormat) { this.cellFormat = new CellFormat(cellFormat); return this; }
/** * Sets the columns of this row beginning with col no 0 with capitalized values. * * @param values * @see #setCapitalizedValuesFrom(int, String...) */ public void setCapitalizedValues(final String... values) { setCapitalizedValuesFrom(0, values); }
@Override public XlsContentProvider setValue(final ExportCell cell, final Object value) { setValue(cell, value, null); return this; }
/** * @param value * @param property * @return this for chaining. */ public ExportCell setValue(final Object value, final String property) { styleProvider.setValue(this, value, property); return this; }
public void addRows(final Object[] rowBeans, final int startCol) { for (final Object rowBean : rowBeans) { addRow(rowBean, startCol); } }
/** * @param name * @param i18nTitle The i18n key of the title. */ public I18nExportColumn(final String name, final String i18nTitle) { super(name, i18nTitle != null ? ExportConfig.getInstance().getDefaultExportContext().getLocalizedString(i18nTitle) : ""); }
/** * @param name * @param i18nTitle The i18n key of the title. * @param width */ public I18nExportColumn(final Enum<?> name, final String i18nTitle, final int width) { super(name, i18nTitle != null ? ExportConfig.getInstance().getDefaultExportContext().getLocalizedString(i18nTitle) : "", width); } }