Class BaseExcelExportTemplate<ID extends Serializable,T extends AbstractEntity<ID>>
- java.lang.Object
-
- com.ocs.dynamo.ui.composite.export.impl.BaseExportTemplate<ID,T>
-
- com.ocs.dynamo.ui.composite.export.impl.BaseExcelExportTemplate<ID,T>
-
- Direct Known Subclasses:
ModelBasedExcelExportTemplate,ModelBasedExcelPivotExportTemplate
public abstract class BaseExcelExportTemplate<ID extends Serializable,T extends AbstractEntity<ID>> extends BaseExportTemplate<ID,T>
-
-
Field Summary
-
Fields inherited from class com.ocs.dynamo.ui.composite.export.impl.BaseExportTemplate
FIXED_COLUMN_WIDTH, MAX_SIZE_BEFORE_STREAMING, PAGE_SIZE, TITLE_ROW_HEIGHT
-
-
Constructor Summary
Constructors Constructor Description BaseExcelExportTemplate(BaseService<ID,T> service, EntityModel<T> entityModel, ExportMode exportMode, SortOrder[] sortOrders, Filter filter, String title, Supplier<CustomXlsStyleGenerator<ID,T>> customGenerator, FetchJoinInformation... joins)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanResize()Indicates whether it is possible to resize the columnsprotected org.apache.poi.ss.usermodel.CellcreateCell(org.apache.poi.ss.usermodel.Row row, int colIndex, T entity, Object value, AttributeModel attributeModel, Object pivotColumnKey)Creates an Excel cell and applies the correct style.protected XlsStyleGenerator<ID,T>createGenerator(org.apache.poi.ss.usermodel.Workbook workbook)Creates the style generatorprotected org.apache.poi.ss.usermodel.WorkbookcreateWorkbook(int size)XlsStyleGenerator<ID,T>getGenerator()protected org.apache.poi.ss.usermodel.WorkbookgetWorkbook()protected voidresizeColumns(org.apache.poi.ss.usermodel.Sheet sheet)Resizes all columns on a sheet if possiblevoidsetGenerator(XlsStyleGenerator<ID,T> generator)voidsetWorkbook(org.apache.poi.ss.usermodel.Workbook workbook)protected voidwriteCellValue(org.apache.poi.ss.usermodel.Cell cell, Object value, EntityModel<T> em, AttributeModel am, boolean forcePercentage)-
Methods inherited from class com.ocs.dynamo.ui.composite.export.impl.BaseExportTemplate
generate, getEntityModel, getEntityModelFactory, getFilter, getJoins, getService, getSortOrders, getTitle, process, processFixed, show
-
-
-
-
Constructor Detail
-
BaseExcelExportTemplate
public BaseExcelExportTemplate(BaseService<ID,T> service, EntityModel<T> entityModel, ExportMode exportMode, SortOrder[] sortOrders, Filter filter, String title, Supplier<CustomXlsStyleGenerator<ID,T>> customGenerator, FetchJoinInformation... joins)
-
-
Method Detail
-
getWorkbook
protected org.apache.poi.ss.usermodel.Workbook getWorkbook()
-
setWorkbook
public void setWorkbook(org.apache.poi.ss.usermodel.Workbook workbook)
-
canResize
protected boolean canResize()
Indicates whether it is possible to resize the columns- Returns:
-
createGenerator
protected XlsStyleGenerator<ID,T> createGenerator(org.apache.poi.ss.usermodel.Workbook workbook)
Creates the style generator- Parameters:
workbook- the work book that is being created- Returns:
-
createCell
protected org.apache.poi.ss.usermodel.Cell createCell(org.apache.poi.ss.usermodel.Row row, int colIndex, T entity, Object value, AttributeModel attributeModel, Object pivotColumnKey)Creates an Excel cell and applies the correct style. The style to use depends on the attribute model and the value to display in the cell- Parameters:
row- the row to which to add the cellcolIndex- the column index of the cellentity- the entity that is represented in the rowvalue- the cell valueattributeModel- the attribute model used to determine the style- Returns:
-
createWorkbook
protected org.apache.poi.ss.usermodel.Workbook createWorkbook(int size)
-
getGenerator
public XlsStyleGenerator<ID,T> getGenerator()
-
setGenerator
public void setGenerator(XlsStyleGenerator<ID,T> generator)
-
resizeColumns
protected void resizeColumns(org.apache.poi.ss.usermodel.Sheet sheet)
Resizes all columns on a sheet if possible- Parameters:
sheet- the sheet
-
writeCellValue
protected void writeCellValue(org.apache.poi.ss.usermodel.Cell cell, Object value, EntityModel<T> em, AttributeModel am, boolean forcePercentage)
-
-