public class ReportTable extends java.lang.Object implements ReportElement
IMPORTANT: Although this class is publicly visible, it is subject to change and may not be implemented by clients!
| Constructor and Description |
|---|
ReportTable(PdfStyleSheet pdfStyleSheet,
float[] cellWidths,
ReportElement[][] elements,
ReportElement[] title) |
| Modifier and Type | Method and Description |
|---|---|
float[] |
getCellWidths() |
ReportElement[][] |
getElements() |
boolean |
getExtraSplitting() |
float |
getFirstSegmentHeight(float allowedWidth)
in case isSplitable is true, this method will be called.
|
float |
getHeight(float allowedWidth)
Height of this segment
|
float |
getHeightOfElementToSplit(float allowedWidth,
float allowedHeight)
For splittable elements returns the current height of the element that needs to be split.
|
java.util.Collection<ReportImage.ImagePrintIntent> |
getImageIntents()
Returns all the images that should have been printed by this element
|
PdfStyleSheet |
getPdfStyleSheet() |
ReportElement[] |
getTitle() |
boolean |
isSplitable()
In case the element may be split over pages, this method should return true
|
float |
print(org.apache.pdfbox.pdmodel.PDDocument document,
org.apache.pdfbox.pdmodel.PDPageContentStream stream,
int pageNumber,
float startX,
float startY,
float allowedWidth) |
void |
setBorder(boolean border) |
void |
setCellPaddingX(float cellPaddingX) |
void |
setCellPaddingY(float cellPaddingY) |
void |
setExtraSplitting(boolean enableExtraSplitting) |
void |
setNoBottomBorder(boolean border) |
void |
setNoInnerBorders(boolean noInnerBorders) |
void |
setNoTopBorder(boolean border) |
void |
setSplitable(boolean isSplitable) |
void |
setTextAlignInColumn(int column,
ReportAlignType alignType,
boolean excludeHeader) |
void |
setVerticalAlignInColumn(int column,
ReportVerticalAlignType alignType) |
ReportElement[] |
split(float allowedWidth)
If the element my be split this method should return two elements.
|
ReportElement[] |
split(float allowedWidth,
float allowedHeight)
Will split the report element, so the height of the first segment will the maximum value less or equal to the allowed height value.
|
ReportElement[] |
splitFirstCell(float allowedHeight,
float allowedWidth) |
public ReportTable(PdfStyleSheet pdfStyleSheet, float[] cellWidths, ReportElement[][] elements, ReportElement[] title)
cellWidths - width of each column (the sum of elements must be 1)elements - elements of each cellpdfStyleSheet - the stylesheet to be used for this tabletitle - the titles for the report (first row)public void setNoInnerBorders(boolean noInnerBorders)
public void setNoBottomBorder(boolean border)
public void setNoTopBorder(boolean border)
public void setBorder(boolean border)
public void setExtraSplitting(boolean enableExtraSplitting)
public void setCellPaddingX(float cellPaddingX)
cellPaddingX - for left and rightpublic void setCellPaddingY(float cellPaddingY)
cellPaddingY - for top and bottompublic boolean getExtraSplitting()
public float print(org.apache.pdfbox.pdmodel.PDDocument document,
org.apache.pdfbox.pdmodel.PDPageContentStream stream,
int pageNumber,
float startX,
float startY,
float allowedWidth)
throws java.io.IOException
print in interface ReportElementdocument - PdfBox documentstream - PdfBox streampageNumber - current page number (0 based)startX - starting xstartY - starting yallowedWidth - maximal width of segmentjava.io.IOException - in case something happens during printingpublic float getHeight(float allowedWidth)
ReportElementgetHeight in interface ReportElementallowedWidth - allowed with of the segmentpublic boolean isSplitable()
ReportElementisSplitable in interface ReportElementpublic void setSplitable(boolean isSplitable)
public float getFirstSegmentHeight(float allowedWidth)
ReportElementgetFirstSegmentHeight in interface ReportElementallowedWidth - the maximum allowed width for this elementpublic java.util.Collection<ReportImage.ImagePrintIntent> getImageIntents()
ReportElementgetImageIntents in interface ReportElementpublic ReportElement[] splitFirstCell(float allowedHeight, float allowedWidth)
public float getHeightOfElementToSplit(float allowedWidth,
float allowedHeight)
ReportElementgetHeightOfElementToSplit in interface ReportElementallowedWidth - width of report elementallowedHeight - max height of first segment.public ReportElement[] split(float allowedWidth, float allowedHeight)
ReportElementsplit in interface ReportElementallowedWidth - width of report elementallowedHeight - max height of first segment.public ReportElement[] split(float allowedWidth)
ReportElementsplit in interface ReportElementallowedWidth - allowed with of the segmentpublic void setTextAlignInColumn(int column,
ReportAlignType alignType,
boolean excludeHeader)
public void setVerticalAlignInColumn(int column,
ReportVerticalAlignType alignType)
public ReportElement[][] getElements()
public ReportElement[] getTitle()
public float[] getCellWidths()
public PdfStyleSheet getPdfStyleSheet()