Package com.storedobject.report
Class ObjectListExcel<T extends StoredObject>
java.lang.Object
com.storedobject.core.StreamContentProducer
com.storedobject.office.AbstractSpreadSheet
com.storedobject.office.Excel
com.storedobject.office.ExcelReport
com.storedobject.report.ObjectListExcel<T>
- Type Parameters:
T
- Type of objects to list (as defined in theReportDefinition
).
- All Implemented Interfaces:
Executable
,ContentProducer
,ContentType
,JSONParameter
,ObjectLister<T>
,Closeable
,AutoCloseable
,Runnable
public class ObjectListExcel<T extends StoredObject>
extends ExcelReport
implements JSONParameter, ObjectLister<T>
Generate an Excel with list of objects. The generated output will be formatted as per the definition in the given
ReportDefinition
instance.
Note: This logic doesn't consider the filters ReportDefinition.getFilter()
while generating the
output.
- Author:
- Syam
-
Field Summary
FieldsFields inherited from class com.storedobject.office.AbstractSpreadSheet
MAX_ROWS, workbook
Fields inherited from class com.storedobject.core.StreamContentProducer
out
-
Constructor Summary
ConstructorsConstructorDescriptionObjectListExcel
(Device device, ReportDefinition reportDefinition) ObjectListExcel
(Device device, Class<T> dataClass, boolean any, String... attributes) ObjectListExcel
(Device device, Class<T> dataClass, String... attributes) ObjectListExcel
(Device device, String reportDefinitionName) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
execute()
The functional interface method specified by this interface.void
Generate the content here and write to 'out'protected String[]
long
getRowCount
(T object) protected HasContacts
void
setErrorMessage
(String errorMessage) void
setExtraCondition
(String extraCondition) void
setLoadFilter
(Predicate<T> loadFilter) void
setParameters
(JSON json) If implemented, this method is typically invoked by the tools before aContentProducer
is asked to produce its output.Methods inherited from class com.storedobject.office.ExcelReport
getDevice, getEntity, getReportFormat, getTransactionManager, setEntity, setTransactionManager, view
Methods inherited from class com.storedobject.office.Excel
createWorkbook, getContentType, getFileExtension, recompute
Methods inherited from class com.storedobject.office.AbstractSpreadSheet
abort, close, getCell, getCell, getCell, getCell, getCellIndex, getCells, getCenteredStyle, getColumnCells, getDateStyle, getDateTimeStyle, getHourStyle, getNextCell, getNextRow, getNextSheet, getNumericStyle, getNumericStyle, getPercentage2Style, getPercentageStyle, getPreviousCell, getPreviousRow, getPreviousSheet, getRightAlignedStyle, getRow, getRow, getRow, getRowCells, getRowIndex, getSheet, getSheet, getSheetIndex, getWorkbook, goToCell, goToCell, goToCell, goToCell, goToRow, isSameSize, moveDown, moveLeft, moveRight, moveUp, save, save, setCellValue, setCellValue, setCellValues, validateCellAddress, validateColumnAddress, validateRangeAddress, validateRowAddress
Methods inherited from class com.storedobject.core.StreamContentProducer
getContent, getError, getFileName, getWriter, produce
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.storedobject.core.ContentProducer
extractContent, getStreamData, getStreamDataProvider, getSystemEntity, saveTo, saveTo, saveTo, saveTo
Methods inherited from interface com.storedobject.core.ContentType
getLink, getMimeType, isAudio, isHTML, isImage, isLink, isMedia, isPDF, isText, isVideo
Methods inherited from interface com.storedobject.common.Executable
act, run
Methods inherited from interface com.storedobject.report.ObjectLister
customizeList, customizeQueryBuilder, customizeTableHeader, getCharCount, getColumnCaption, getOrderBy, getReportDefinition
-
Field Details
-
reportDefinition
-
row
protected long row
-
-
Constructor Details
-
ObjectListExcel
-
ObjectListExcel
-
ObjectListExcel
-
ObjectListExcel
-
ObjectListExcel
-
ObjectListExcel
-
-
Method Details
-
execute
public final void execute()Description copied from interface:Executable
The functional interface method specified by this interface.- Specified by:
execute
in interfaceContentProducer
- Specified by:
execute
in interfaceExecutable
- Overrides:
execute
in classExcelReport
-
getTitleEntity
-
getExtraCaptions
-
generateContent
Description copied from class:StreamContentProducer
Generate the content here and write to 'out'- Overrides:
generateContent
in classAbstractSpreadSheet
- Throws:
Exception
- Can throw anything
-
setExtraCondition
- Specified by:
setExtraCondition
in interfaceObjectLister<T extends StoredObject>
-
getExtraCondition
- Specified by:
getExtraCondition
in interfaceObjectLister<T extends StoredObject>
-
setLoadFilter
-
getLoadFilter
- Specified by:
getLoadFilter
in interfaceObjectLister<T extends StoredObject>
-
getRowCount
-
setParameters
Description copied from interface:JSONParameter
If implemented, this method is typically invoked by the tools before aContentProducer
is asked to produce its output. It can extract its required parameter values from theJSON
structure.- Specified by:
setParameters
in interfaceJSONParameter
- Parameters:
json
-JSON
containing parameter values.
-
getReportDefinition
- Specified by:
getReportDefinition
in interfaceObjectLister<T extends StoredObject>
-
setErrorMessage
- Specified by:
setErrorMessage
in interfaceObjectLister<T extends StoredObject>
-