Class TableReport
java.lang.Object
net.sf.jasperreports.components.table.fill.TableReport
- All Implemented Interfaces:
JRDefaultStyleProvider
,JRIdentifiable
,JRPropertiesHolder
,JRReport
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected static class
protected class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
protected static final String
protected static final String
static final String
static final String
Property that enables/disables the automatic addition of specific custom properties to the elements that make up the table and its cells.static final String
Column property that specifies the field to be used for sorting, filtering and conditional formattingstatic final String
Column property that enables/disables filteringstatic final String
Column property that enables/disables sortingstatic final String
Column property that specifies the variable to be used for sorting, filtering and conditional formattingstatic final String
Global property that specifies the character to be used on the column header when the tables's column is sorted descendingstatic final String
Global property that specifies the character to be used on the column header when the tables's column has a filtered appliedstatic final String
Property that enables/disables the floating header in the table component when scrolling.static final String
Deprecated.static final String
Global property that specifies the font to be used for the icons on the column headerstatic final String
Property that enables/disables the interactivity in the table componentstatic final String
Property that provides a name for table.static final String
Global property that specifies the character to be used on the column header when the tables's column is sorted ascendingprotected static final String
static final String
static final String
protected static final String
Fields inherited from interface net.sf.jasperreports.engine.JRReport
CONFIG_PROPERTY_WHEN_NO_DATA_TYPE, LANGUAGE_GROOVY, LANGUAGE_JAVA
-
Constructor Summary
ConstructorsConstructorDescriptionTableReport
(FillContext fillContext, TableComponent table, TableReportDataset mainDataset, List<FillColumn> fillColumns, BuiltinExpressionEvaluatorFactory builtinEvaluatorFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addSummaryGroup
(List<FillColumn> fillColumns) protected int
computeTableWidth
(List<FillColumn> fillColumns) protected JRElement
createCell
(JRElementGroup parentGroup, BaseCell cell, int originalWidth, int width, int x, int y, Integer columnHashCode, UUID uuid, boolean forceFrame) protected JRElement
createCellElement
(JRElementGroup elementGroup, BaseCell cell, int originalWidth, int width, int x, int y, Integer columnHashCode) protected JRDesignBand
createColumnHeader
(List<FillColumn> fillColumns) protected JRBand
createDetailBand
(List<FillColumn> fillColumns) protected JRBand
createGroupFooter
(String groupName, List<FillColumn> fillColumns) protected JRBand
createGroupHeader
(String groupName, List<FillColumn> fillColumns) protected JRDesignBand
createNoData
(BaseCell cell) protected JRDesignBand
createPageFooter
(List<FillColumn> fillColumns) protected JRDesignBand
createSummary
(List<FillColumn> fillColumns) protected JRDesignBand
createTitle
(List<FillColumn> fillColumns) int
Gets the number of columns on each pageSpecifies whether columns will be filled from left to right or from right to left.int
Specifies the space between columns on the same page.int
Returns the datasets of this report.Returns a default style.Deprecated.protected JRField
JRField[]
Gets the name of the class implementing theFormatFactory
interface to use with this report.protected TimeZone
getFormatTimeZone
(JRTextField textField, Class<?> valueClass) JRGroup[]
String[]
Gets an array of imports (needed if report expression require additional classes in order to compile).Gets the report language.int
Returns the main report dataset.getName()
Gets the report name.Specifies whether document pages will be rendered in a portrait or landscape layout.int
int
Returns the parent properties holder, whose properties are used as defaults for this object.Specifies whether columns will be filled horizontally or vertically.Returns this object's properties map.getProperty
(String name) Gets a property valueReturns the list of dynamic/expression-based properties for this report.String[]
Gets an array of report properties names.getQuery()
Gets the base name of the report associated resource bundle.int
Specifies whether report sections are made of bands or of parts.Returns a style resolver.JRStyle[]
Gets an array of report styles.Returns the list of report templates.getTitle()
int
getUUID()
protected JRVariable
getVariable
(String name) Specifies the report behavior in case of empty datasources.Returns the resource missing handling type.boolean
Checks whether the object has any properties.protected boolean
boolean
Specifies if the column footer section will be printed at the bottom of the column or if it will immediately follow the last detail or group footer printed on the current column.boolean
Decides whether to use pagination when filling the report.boolean
boolean
Specifies if the summary section will be printed on a separate last page.boolean
Specifies if the summary section will be accompanied by the page header and footer.boolean
Specifies if the title section will be printed on a separate initial page.void
removeProperty
(String name) protected void
scaleCellElement
(JRElement element, Integer cellWidth, int scaledCellWidth) void
setProperty
(String name, String value) void
setTableInstanceIndex
(int instanceIndex) void
setWhenNoDataType
(WhenNoDataTypeEnum whenNoDataType) Sets the report behavior in case of empty datasources.void
setWhenResourceMissingType
(WhenResourceMissingTypeEnum whenResourceMissingType) Sets the resource missing handling type.protected JRSection
-
Field Details
-
EXCEPTION_MESSAGE_KEY_UNKNOWN_CHILD_TYPE
- See Also:
-
EXCEPTION_MESSAGE_KEY_FIELD_NOT_FOUND
- See Also:
-
EXCEPTION_MESSAGE_KEY_VARIABLE_NOT_FOUND
- See Also:
-
EXCEPTION_MESSAGE_KEY_UNRECOGNIZED_FILTER_EXPRESSION_TYPE
- See Also:
-
METADATA_KEY_QUALIFICATION
- See Also:
-
PROPERTY_UP_ARROW_CHAR
Global property that specifies the character to be used on the column header when the tables's column is sorted ascending- See Also:
-
PROPERTY_DOWN_ARROW_CHAR
Global property that specifies the character to be used on the column header when the tables's column is sorted descending- See Also:
-
PROPERTY_FILTER_CHAR
Global property that specifies the character to be used on the column header when the tables's column has a filtered applied- See Also:
-
PROPERTY_ICON_FONT
Global property that specifies the font to be used for the icons on the column header- See Also:
-
PROPERTY_INTERACTIVE_TABLE
Property that enables/disables the interactivity in the table componentThe property can be set:
- globally
- at report level
- at component level
- at column level
The default global value of this property is
true
- See Also:
-
PROPERTY_FLOATING_HEADER
Property that enables/disables the floating header in the table component when scrolling. If the interactivity has been disabled by settingPROPERTY_INTERACTIVE_TABLE
tofalse
, then setting this property will have no effect.It can be set:
- globally
- at report level
- at component level
The default global value of this property is
true
- See Also:
-
PROPERTY_GENERATE_TABLE_PDF_TAGS
Deprecated.Replaced byPROPERTY_ACCESSIBLE_TABLE
.Property that enables/disables the automatic addition of specific custom properties to table cell elements, that would in turn trigger the creation of special document accessibility tags during PDF exportThe property can be set:
- globally
- at report level
- at component level
The default global value of this property is
false
- See Also:
-
PROPERTY_ACCESSIBLE_TABLE
Property that enables/disables the automatic addition of specific custom properties to the elements that make up the table and its cells. These properties would be then used to produce special document accessibility metadata during exports.The property can be set:
- globally
- at report level
- at component level
- See Also:
-
PROPERTY_COLUMN_FIELD
Column property that specifies the field to be used for sorting, filtering and conditional formatting- See Also:
-
PROPERTY_COLUMN_VARIABLE
Column property that specifies the variable to be used for sorting, filtering and conditional formatting- See Also:
-
PROPERTY_COLUMN_SORTABLE
Column property that enables/disables sortingIt defaults to
true
- See Also:
-
PROPERTY_COLUMN_FILTERABLE
Column property that enables/disables filteringIt defaults to
true
- See Also:
-
PROPERTY_TABLE_NAME
Property that provides a name for table.The name is used as report name in element origins.
- See Also:
-
SUMMARY_GROUP_NAME
- See Also:
-
HTML_CLASS_CELL_PREFIX
- See Also:
-
HTML_CLASS_CELL
- See Also:
-
TABLE_HEADER_LABEL_MATCHER_EXPORT_KEY
- See Also:
-
TABLE_HEADER_ICON_LABEL_MATCHER_EXPORT_KEY
- See Also:
-
TABLE_SCRIPTLET_NAME
- See Also:
-
-
Constructor Details
-
TableReport
public TableReport(FillContext fillContext, TableComponent table, TableReportDataset mainDataset, List<FillColumn> fillColumns, BuiltinExpressionEvaluatorFactory builtinEvaluatorFactory)
-
-
Method Details
-
createDetailBand
-
getFormatTimeZone
-
createColumnHeader
-
createNoData
-
createTitle
-
createSummary
-
createGroupHeader
-
isAccessibleTable
protected boolean isAccessibleTable() -
computeTableWidth
-
addSummaryGroup
-
createCell
protected JRElement createCell(JRElementGroup parentGroup, BaseCell cell, int originalWidth, int width, int x, int y, Integer columnHashCode, UUID uuid, boolean forceFrame) -
createCellElement
protected JRElement createCellElement(JRElementGroup elementGroup, BaseCell cell, int originalWidth, int width, int x, int y, Integer columnHashCode) -
scaleCellElement
-
wrapBand
-
getBackground
- Specified by:
getBackground
in interfaceJRReport
-
getBottomMargin
public int getBottomMargin()- Specified by:
getBottomMargin
in interfaceJRReport
-
getColumnCount
Description copied from interface:JRReport
Gets the number of columns on each page- Specified by:
getColumnCount
in interfaceJRReport
-
getColumnHeader
- Specified by:
getColumnHeader
in interfaceJRReport
-
getColumnSpacing
public int getColumnSpacing()Description copied from interface:JRReport
Specifies the space between columns on the same page.- Specified by:
getColumnSpacing
in interfaceJRReport
-
getColumnWidth
public int getColumnWidth()- Specified by:
getColumnWidth
in interfaceJRReport
-
getDatasets
Description copied from interface:JRReport
Returns the datasets of this report.- Specified by:
getDatasets
in interfaceJRReport
- Returns:
- the datasets of this report
-
getDetail
Deprecated. -
getDetailSection
- Specified by:
getDetailSection
in interfaceJRReport
-
getFields
-
getField
-
getFormatFactoryClass
Description copied from interface:JRReport
Gets the name of the class implementing theFormatFactory
interface to use with this report.- Specified by:
getFormatFactoryClass
in interfaceJRReport
-
getGroups
-
getImports
Description copied from interface:JRReport
Gets an array of imports (needed if report expression require additional classes in order to compile).- Specified by:
getImports
in interfaceJRReport
-
getLanguage
Description copied from interface:JRReport
Gets the report language. Should be Java or Groovy.- Specified by:
getLanguage
in interfaceJRReport
-
getLeftMargin
public int getLeftMargin()- Specified by:
getLeftMargin
in interfaceJRReport
-
getMainDataset
Description copied from interface:JRReport
Returns the main report dataset.The main report dataset consists of all parameters, fields, variables and groups of the report.
- Specified by:
getMainDataset
in interfaceJRReport
- Returns:
- the main report dataset
-
getName
Description copied from interface:JRReport
Gets the report name. -
getNoData
-
getOrientation
Description copied from interface:JRReport
Specifies whether document pages will be rendered in a portrait or landscape layout.- Specified by:
getOrientation
in interfaceJRReport
- Returns:
- a value representing one of the orientation constants in
OrientationEnum
-
getPageHeader
- Specified by:
getPageHeader
in interfaceJRReport
-
getPageHeight
public int getPageHeight()- Specified by:
getPageHeight
in interfaceJRReport
-
getPageWidth
public int getPageWidth()- Specified by:
getPageWidth
in interfaceJRReport
-
getParameters
- Specified by:
getParameters
in interfaceJRReport
-
getPrintOrder
Description copied from interface:JRReport
Specifies whether columns will be filled horizontally or vertically.- Specified by:
getPrintOrder
in interfaceJRReport
- Returns:
- a value representing one of the print order constants in
PrintOrderEnum
-
getColumnDirection
Description copied from interface:JRReport
Specifies whether columns will be filled from left to right or from right to left.- Specified by:
getColumnDirection
in interfaceJRReport
- Returns:
- a value representing one of the column direction constants in
RunDirectionEnum
-
getProperty
Description copied from interface:JRReport
Gets a property value- Specified by:
getProperty
in interfaceJRReport
- Parameters:
name
- the property name
-
getPropertyNames
Description copied from interface:JRReport
Gets an array of report properties names.- Specified by:
getPropertyNames
in interfaceJRReport
-
getQuery
-
getResourceBundle
Description copied from interface:JRReport
Gets the base name of the report associated resource bundle.- Specified by:
getResourceBundle
in interfaceJRReport
-
getRightMargin
public int getRightMargin()- Specified by:
getRightMargin
in interfaceJRReport
-
getScriptletClass
- Specified by:
getScriptletClass
in interfaceJRReport
-
getScriptlets
- Specified by:
getScriptlets
in interfaceJRReport
-
getSortFields
- Specified by:
getSortFields
in interfaceJRReport
-
getStyles
Description copied from interface:JRReport
Gets an array of report styles. -
getSummary
- Specified by:
getSummary
in interfaceJRReport
-
getTemplates
Description copied from interface:JRReport
Returns the list of report templates. A report template is an expression which resolves at runtime to atemplate
. Templates include styles which can be used in the report. The order in which the templates are included in the report is important:- A style's parent must appear before the style itself.
- A style overrides styles with the same name that are placed before it. Also, report styles override templates styles with the same name.
- Specified by:
getTemplates
in interfaceJRReport
- Returns:
- the list of report templates, or
null
if none - See Also:
-
getTitle
-
getTopMargin
public int getTopMargin()- Specified by:
getTopMargin
in interfaceJRReport
-
getVariables
- Specified by:
getVariables
in interfaceJRReport
-
getVariable
-
getWhenNoDataType
Description copied from interface:JRReport
Specifies the report behavior in case of empty datasources.- Specified by:
getWhenNoDataType
in interfaceJRReport
-
getSectionType
Description copied from interface:JRReport
Specifies whether report sections are made of bands or of parts.- Specified by:
getSectionType
in interfaceJRReport
- Returns:
- a value representing one of the section type constants in
SectionTypeEnum
-
getWhenResourceMissingType
Description copied from interface:JRReport
Returns the resource missing handling type.- Specified by:
getWhenResourceMissingType
in interfaceJRReport
-
isIgnorePagination
public boolean isIgnorePagination()Description copied from interface:JRReport
Decides whether to use pagination when filling the report.If set to
true
the report will be generated on one long page.The design attribute can be overridden at fill time by the
IS_IGNORE_PAGINATION
parameter.- Specified by:
isIgnorePagination
in interfaceJRReport
- Returns:
- whether to use pagination when filling the report
-
isSummaryNewPage
public boolean isSummaryNewPage()Description copied from interface:JRReport
Specifies if the summary section will be printed on a separate last page.- Specified by:
isSummaryNewPage
in interfaceJRReport
-
isTitleNewPage
public boolean isTitleNewPage()Description copied from interface:JRReport
Specifies if the title section will be printed on a separate initial page.- Specified by:
isTitleNewPage
in interfaceJRReport
-
removeProperty
- Specified by:
removeProperty
in interfaceJRReport
-
setProperty
- Specified by:
setProperty
in interfaceJRReport
-
setWhenNoDataType
Description copied from interface:JRReport
Sets the report behavior in case of empty datasources.- Specified by:
setWhenNoDataType
in interfaceJRReport
-
setWhenResourceMissingType
Description copied from interface:JRReport
Sets the resource missing handling type.- Specified by:
setWhenResourceMissingType
in interfaceJRReport
- Parameters:
whenResourceMissingType
- the resource missing handling type
-
getDefaultStyle
Description copied from interface:JRDefaultStyleProvider
Returns a default style.- Specified by:
getDefaultStyle
in interfaceJRDefaultStyleProvider
-
getStyleResolver
Description copied from interface:JRDefaultStyleProvider
Returns a style resolver.- Specified by:
getStyleResolver
in interfaceJRDefaultStyleProvider
-
getParentProperties
Description copied from interface:JRPropertiesHolder
Returns the parent properties holder, whose properties are used as defaults for this object.- Specified by:
getParentProperties
in interfaceJRPropertiesHolder
- Returns:
- the parent properties holder, or
null
if no parent
-
getPropertiesMap
Description copied from interface:JRPropertiesHolder
Returns this object's properties map.- Specified by:
getPropertiesMap
in interfaceJRPropertiesHolder
- Returns:
- this object's properties map
-
hasProperties
public boolean hasProperties()Description copied from interface:JRPropertiesHolder
Checks whether the object has any properties.- Specified by:
hasProperties
in interfaceJRPropertiesHolder
- Returns:
- whether the object has any properties
-
getPropertyExpressions
Description copied from interface:JRReport
Returns the list of dynamic/expression-based properties for this report.- Specified by:
getPropertyExpressions
in interfaceJRReport
- Returns:
- an array containing the expression-based properties of this report
-
getUUID
- Specified by:
getUUID
in interfaceJRIdentifiable
-
isInteractiveTable
public boolean isInteractiveTable() -
setTableInstanceIndex
public void setTableInstanceIndex(int instanceIndex)
-
PROPERTY_ACCESSIBLE_TABLE
.