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,RequiresTransactionManager,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 PDFTableThe main table.Fields inherited from class com.storedobject.pdf.PDF
ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, pageSizes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanThis will be invoked before printing each row.protected ObjectcustomizeCellValue(String columnName, T object, Object cellValue) This method is invoked before printing a cell value to obtain its customized value.voidGenerate the content by writing stuff to the PDF.protected StringgetCaption(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 intgetHorizontalAlignment(String columnName) Get the horizontal alignment.protected intgetVerticalAlignment(String columnName) Get the vertical alignment.protected intGet the relative width of the column (Default implementation returns 10).protected voidThis method is invoked to print a cell value of the row.protected voidrowPrinted(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, viewMethods inherited from class com.storedobject.pdf.PDF
aboutToAddExternalContent, add, add, add, add, addBlankRow, addBlankRow, addBlankRow, 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, toCharCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.core.ContentProducer
abort, getError, getStreamData, getStreamDataProvider, getSystemEntity, ready, saveTo, saveTo, saveTo, saveToMethods inherited from interface com.storedobject.core.ContentType
getLink, getMimeType, isAudio, isHTML, isImage, isLink, isMedia, isPDF, isText, isVideoMethods 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:PDFGenerate the content by writing stuff to the PDF.- Specified by:
generateContentin 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_CENTERorPDFElement.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_MIDDLEorPDFElement.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
-