Package com.storedobject.ui
Class ObjectGridReport<T extends StoredObject>
java.lang.Object
com.storedobject.pdf.PDF
com.storedobject.pdf.PDFReport
com.storedobject.ui.ObjectGridReport<T>
- Type Parameters:
T
- Type of object in the grid.
- All Implemented Interfaces:
Executable
,ContentProducer
,ContentType
,Closeable
,AutoCloseable
,Runnable
Create a PDF report from the grid rows.
- Author:
- Syam
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.pdf.PDF
PDF.ObjectFormTable<T extends StoredObject>, PDF.ObjectTable<T extends StoredObject>, PDF.PDFContent, PDF.Text
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ObjectListGrid
<T> The associated grid.protected PDFTable
The main table.Fields inherited from class com.storedobject.pdf.PDF
ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, pageSizes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
This will be invoked before printing each row.protected Object
customizeCellValue
(String columnName, T object, Object cellValue) This method is invoked before printing a cell value to obtain its customized value.void
Generate the content by writing stuff to the PDF.protected String
getCaption
(String columnName) Get the caption of the column (Default implementation returns corresponding grid column caption).Get a customizer for the cells that will be created for adding to the report.protected int
getHorizontalAlignment
(String columnName) Get the horizontal alignment.protected int
getVerticalAlignment
(String columnName) Get the vertical alignment.protected int
Get the relative width of the column (Default implementation returns 10).protected void
This method is invoked to print a cell value of the row.protected void
rowPrinted
(T object) This method is invoked after a row is printed so that any extra printing or computation can be done here.Methods inherited from class com.storedobject.pdf.PDFReport
createTitleTable, createTitleTable, createTitleTable, createTitleTable, execute, execute, extractContent, getDevice, getLogo, getLogoName, getLogoPosition, getProductLogo, getProductLogoName, getTitle, getTitleTable, getTitleText, getUser, setTitleText, view
Methods inherited from class com.storedobject.pdf.PDF
aboutToAddExternalContent, add, add, add, add, addBlankRow, addBlankRow, addBlankRow, addCentered, addContent, addContent, addContent, addContent, addContent, addContent, addContent, addContent, addContent, addContent, addGap, addHTML, addHTML, addHTML, addHTML, addHTML, addHTML, addImage, addImage, addImage, addingExternalContent, addTitles, addTitles, addTitles, addTitles, addTitles, addTitles, addToTable, addToTable, addToTable, addToTable, addToTable, addToTable, addToTable, addToTable, addToTableCentered, addToTableCentered, chainTo, close, createCell, createCell, createCell, createCell, createCell, createCell, createCell, createCell, createCenteredCell, createCenteredCell, createGraphics, createGraphics, createImage, createImage, createImage, createImage, createImage, createImage, createImage, createImage, createImage, createImageFromHTML, createImageFromHTML, createImageFromHTML, createImageFromHTML, createImageFromSVG, createImageFromSVG, createTable, createTable, createText, createText, createText, createTitleText, createTitleText, createTitleText, drawTable, drawTable, drawTable, dumpError, getBottomMargin, getContent, getContentType, getEntity, getEntityLocation, getEntityName, getFileExtension, getFileName, getFontSize, getFooter, getHeight, getLeftMargin, getPageNumber, getPageOrientation, getPageSize, getPageSize, getPageSizeIndex, getReportFormat, getReportStage, getRightMargin, getTopMargin, getTransactionManager, getWaterMark, getWidth, getY, getY, log, newPage, newReportStage, newReportStage, open, pageCompleted, pageStarted, printAuditTrail, printLetterHeadOnEveryPage, printLetterHeadOnEveryPage, printPageNumber, printPageNumber, printTotalPageNumber, printTotalPageNumber, produce, readContent, setDefaultCellCustomizer, setEntity, setError, setFontSize, setLanguage, setLanguage, setLogo, setLogo, setPageNumber, setPageSizeIndex, setPassword, setReportFormat, setTransactionManager, setWaterMark, showText, toCharCount
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
abort, getError, 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
-
Field Details
-
grid
The associated grid. -
table
The main table.
-
-
Constructor Details
-
ObjectGridReport
-
-
Method Details
-
generateContent
Description copied from class:PDF
Generate the content by writing stuff to the PDF.- Specified by:
generateContent
in classPDF
- Throws:
Exception
- Any exception.
-
getCaption
-
getWidth
Get the relative width of the column (Default implementation returns 10).Note: Return 0 if you don't want to print this column.
- Parameters:
columnName
- Column name.- Returns:
- Relative width.
-
getHorizontalAlignment
Get the horizontal alignment. Should return one ofPDFElement.ALIGN_LEFT
,PDFElement.ALIGN_CENTER
orPDFElement.ALIGN_RIGHT
. Default implementation returns a value based on the alignment of the grid's column.- Parameters:
columnName
- Column name.- Returns:
- Alignment.
-
getVerticalAlignment
Get the vertical alignment. Should return one ofPDFElement.ALIGN_BOTTOM
,PDFElement.ALIGN_MIDDLE
orPDFElement.ALIGN_TOP
. Default implementation returnsPDFElement.ALIGN_MIDDLE
.- Parameters:
columnName
- Column name.- Returns:
- Alignment.
-
canPrint
This will be invoked before printing each row. Row will be skipped if returned false from this method.- Parameters:
object
- The object in the current row.- Returns:
- True/false.
-
rowPrinted
This method is invoked after a row is printed so that any extra printing or computation can be done here.- Parameters:
object
- The object in the current row.
-
printCell
-
customizeCellValue
This method is invoked before printing a cell value to obtain its customized value. Default implementation returns the same value without any changes.- Parameters:
columnName
- Column name.object
- The object in the current row.cellValue
- Cell value.- Returns:
- Customized cell value.
-
getCellCustomizer
-