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 classprotected classprotected classprotected classprotected classprotected classprotected classprotected classprotected classprotected classprotected classprotected classprotected static classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final StringProperty that enables/disables the automatic addition of specific custom properties to the elements that make up the table and its cells.static final StringColumn property that specifies the field to be used for sorting, filtering and conditional formattingstatic final StringColumn property that enables/disables filteringstatic final StringColumn property that enables/disables sortingstatic final StringColumn property that specifies the variable to be used for sorting, filtering and conditional formattingstatic final StringGlobal property that specifies the character to be used on the column header when the tables's column is sorted descendingstatic final StringGlobal property that specifies the character to be used on the column header when the tables's column has a filtered appliedstatic final StringProperty that enables/disables the floating header in the table component when scrolling.static final StringDeprecated.static final StringGlobal property that specifies the font to be used for the icons on the column headerstatic final StringProperty that enables/disables the interactivity in the table componentstatic final StringProperty that provides a name for table.static final StringGlobal property that specifies the character to be used on the column header when the tables's column is sorted ascendingprotected static final Stringstatic final Stringstatic final Stringprotected static final StringFields 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 voidaddSummaryGroup(List<FillColumn> fillColumns) protected intcomputeTableWidth(List<FillColumn> fillColumns) protected JRElementcreateCell(JRElementGroup parentGroup, BaseCell cell, int originalWidth, int width, int x, int y, Integer columnHashCode, UUID uuid, boolean forceFrame) protected JRElementcreateCellElement(JRElementGroup elementGroup, BaseCell cell, int originalWidth, int width, int x, int y, Integer columnHashCode) protected JRDesignBandcreateColumnHeader(List<FillColumn> fillColumns) protected JRBandcreateDetailBand(List<FillColumn> fillColumns) protected JRBandcreateGroupFooter(String groupName, List<FillColumn> fillColumns) protected JRBandcreateGroupHeader(String groupName, List<FillColumn> fillColumns) protected JRDesignBandcreateNoData(BaseCell cell) protected JRDesignBandcreatePageFooter(List<FillColumn> fillColumns) protected JRDesignBandcreateSummary(List<FillColumn> fillColumns) protected JRDesignBandcreateTitle(List<FillColumn> fillColumns) intGets the number of columns on each pageSpecifies whether columns will be filled from left to right or from right to left.intSpecifies the space between columns on the same page.intReturns the datasets of this report.Returns a default style.Deprecated.protected JRFieldJRField[]Gets the name of the class implementing theFormatFactoryinterface to use with this report.protected TimeZonegetFormatTimeZone(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.intReturns the main report dataset.getName()Gets the report name.Specifies whether document pages will be rendered in a portrait or landscape layout.intintReturns 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.intSpecifies 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()intgetUUID()protected JRVariablegetVariable(String name) Specifies the report behavior in case of empty datasources.Returns the resource missing handling type.booleanChecks whether the object has any properties.protected booleanbooleanSpecifies 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.booleanDecides whether to use pagination when filling the report.booleanbooleanSpecifies if the summary section will be printed on a separate last page.booleanSpecifies if the summary section will be accompanied by the page header and footer.booleanSpecifies if the title section will be printed on a separate initial page.voidremoveProperty(String name) protected voidscaleCellElement(JRElement element, Integer cellWidth, int scaledCellWidth) voidsetProperty(String name, String value) voidsetTableInstanceIndex(int instanceIndex) voidsetWhenNoDataType(WhenNoDataTypeEnum whenNoDataType) Sets the report behavior in case of empty datasources.voidsetWhenResourceMissingType(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_TABLEtofalse, 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:
getBackgroundin interfaceJRReport
-
getBottomMargin
public int getBottomMargin()- Specified by:
getBottomMarginin interfaceJRReport
-
getColumnCount
Description copied from interface:JRReportGets the number of columns on each page- Specified by:
getColumnCountin interfaceJRReport
-
getColumnHeader
- Specified by:
getColumnHeaderin interfaceJRReport
-
getColumnSpacing
public int getColumnSpacing()Description copied from interface:JRReportSpecifies the space between columns on the same page.- Specified by:
getColumnSpacingin interfaceJRReport
-
getColumnWidth
public int getColumnWidth()- Specified by:
getColumnWidthin interfaceJRReport
-
getDatasets
Description copied from interface:JRReportReturns the datasets of this report.- Specified by:
getDatasetsin interfaceJRReport- Returns:
- the datasets of this report
-
getDetail
Deprecated. -
getDetailSection
- Specified by:
getDetailSectionin interfaceJRReport
-
getFields
-
getField
-
getFormatFactoryClass
Description copied from interface:JRReportGets the name of the class implementing theFormatFactoryinterface to use with this report.- Specified by:
getFormatFactoryClassin interfaceJRReport
-
getGroups
-
getImports
Description copied from interface:JRReportGets an array of imports (needed if report expression require additional classes in order to compile).- Specified by:
getImportsin interfaceJRReport
-
getLanguage
Description copied from interface:JRReportGets the report language. Should be Java or Groovy.- Specified by:
getLanguagein interfaceJRReport
-
getLeftMargin
public int getLeftMargin()- Specified by:
getLeftMarginin interfaceJRReport
-
getMainDataset
Description copied from interface:JRReportReturns the main report dataset.The main report dataset consists of all parameters, fields, variables and groups of the report.
- Specified by:
getMainDatasetin interfaceJRReport- Returns:
- the main report dataset
-
getName
Description copied from interface:JRReportGets the report name. -
getNoData
-
getOrientation
Description copied from interface:JRReportSpecifies whether document pages will be rendered in a portrait or landscape layout.- Specified by:
getOrientationin interfaceJRReport- Returns:
- a value representing one of the orientation constants in
OrientationEnum
-
getPageHeader
- Specified by:
getPageHeaderin interfaceJRReport
-
getPageHeight
public int getPageHeight()- Specified by:
getPageHeightin interfaceJRReport
-
getPageWidth
public int getPageWidth()- Specified by:
getPageWidthin interfaceJRReport
-
getParameters
- Specified by:
getParametersin interfaceJRReport
-
getPrintOrder
Description copied from interface:JRReportSpecifies whether columns will be filled horizontally or vertically.- Specified by:
getPrintOrderin interfaceJRReport- Returns:
- a value representing one of the print order constants in
PrintOrderEnum
-
getColumnDirection
Description copied from interface:JRReportSpecifies whether columns will be filled from left to right or from right to left.- Specified by:
getColumnDirectionin interfaceJRReport- Returns:
- a value representing one of the column direction constants in
RunDirectionEnum
-
getProperty
Description copied from interface:JRReportGets a property value- Specified by:
getPropertyin interfaceJRReport- Parameters:
name- the property name
-
getPropertyNames
Description copied from interface:JRReportGets an array of report properties names.- Specified by:
getPropertyNamesin interfaceJRReport
-
getQuery
-
getResourceBundle
Description copied from interface:JRReportGets the base name of the report associated resource bundle.- Specified by:
getResourceBundlein interfaceJRReport
-
getRightMargin
public int getRightMargin()- Specified by:
getRightMarginin interfaceJRReport
-
getScriptletClass
- Specified by:
getScriptletClassin interfaceJRReport
-
getScriptlets
- Specified by:
getScriptletsin interfaceJRReport
-
getSortFields
- Specified by:
getSortFieldsin interfaceJRReport
-
getStyles
Description copied from interface:JRReportGets an array of report styles. -
getSummary
- Specified by:
getSummaryin interfaceJRReport
-
getTemplates
Description copied from interface:JRReportReturns 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:
getTemplatesin interfaceJRReport- Returns:
- the list of report templates, or
nullif none - See Also:
-
getTitle
-
getTopMargin
public int getTopMargin()- Specified by:
getTopMarginin interfaceJRReport
-
getVariables
- Specified by:
getVariablesin interfaceJRReport
-
getVariable
-
getWhenNoDataType
Description copied from interface:JRReportSpecifies the report behavior in case of empty datasources.- Specified by:
getWhenNoDataTypein interfaceJRReport
-
getSectionType
Description copied from interface:JRReportSpecifies whether report sections are made of bands or of parts.- Specified by:
getSectionTypein interfaceJRReport- Returns:
- a value representing one of the section type constants in
SectionTypeEnum
-
getWhenResourceMissingType
Description copied from interface:JRReportReturns the resource missing handling type.- Specified by:
getWhenResourceMissingTypein interfaceJRReport
-
isIgnorePagination
public boolean isIgnorePagination()Description copied from interface:JRReportDecides whether to use pagination when filling the report.If set to
truethe report will be generated on one long page.The design attribute can be overridden at fill time by the
IS_IGNORE_PAGINATIONparameter.- Specified by:
isIgnorePaginationin interfaceJRReport- Returns:
- whether to use pagination when filling the report
-
isSummaryNewPage
public boolean isSummaryNewPage()Description copied from interface:JRReportSpecifies if the summary section will be printed on a separate last page.- Specified by:
isSummaryNewPagein interfaceJRReport
-
isTitleNewPage
public boolean isTitleNewPage()Description copied from interface:JRReportSpecifies if the title section will be printed on a separate initial page.- Specified by:
isTitleNewPagein interfaceJRReport
-
removeProperty
- Specified by:
removePropertyin interfaceJRReport
-
setProperty
- Specified by:
setPropertyin interfaceJRReport
-
setWhenNoDataType
Description copied from interface:JRReportSets the report behavior in case of empty datasources.- Specified by:
setWhenNoDataTypein interfaceJRReport
-
setWhenResourceMissingType
Description copied from interface:JRReportSets the resource missing handling type.- Specified by:
setWhenResourceMissingTypein interfaceJRReport- Parameters:
whenResourceMissingType- the resource missing handling type
-
getDefaultStyle
Description copied from interface:JRDefaultStyleProviderReturns a default style.- Specified by:
getDefaultStylein interfaceJRDefaultStyleProvider
-
getStyleResolver
Description copied from interface:JRDefaultStyleProviderReturns a style resolver.- Specified by:
getStyleResolverin interfaceJRDefaultStyleProvider
-
getParentProperties
Description copied from interface:JRPropertiesHolderReturns the parent properties holder, whose properties are used as defaults for this object.- Specified by:
getParentPropertiesin interfaceJRPropertiesHolder- Returns:
- the parent properties holder, or
nullif no parent
-
getPropertiesMap
Description copied from interface:JRPropertiesHolderReturns this object's properties map.- Specified by:
getPropertiesMapin interfaceJRPropertiesHolder- Returns:
- this object's properties map
-
hasProperties
public boolean hasProperties()Description copied from interface:JRPropertiesHolderChecks whether the object has any properties.- Specified by:
hasPropertiesin interfaceJRPropertiesHolder- Returns:
- whether the object has any properties
-
getPropertyExpressions
Description copied from interface:JRReportReturns the list of dynamic/expression-based properties for this report.- Specified by:
getPropertyExpressionsin interfaceJRReport- Returns:
- an array containing the expression-based properties of this report
-
getUUID
- Specified by:
getUUIDin interfaceJRIdentifiable
-
isInteractiveTable
public boolean isInteractiveTable() -
setTableInstanceIndex
public void setTableInstanceIndex(int instanceIndex)
-
PROPERTY_ACCESSIBLE_TABLE.