net.sf.jasperreports.components.table.fill
Class TableReport

java.lang.Object
  extended by net.sf.jasperreports.components.table.fill.TableReport
All Implemented Interfaces:
JRDefaultStyleProvider, JRIdentifiable, JRPropertiesHolder, JRReport

public class TableReport
extends java.lang.Object
implements JRReport

Version:
$Id: TableReport.java 5349 2012-05-08 14:25:05Z teodord $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)

Nested Class Summary
protected  class TableReport.ColumnHeaderCreator
           
protected  class TableReport.DetailBandCreator
           
protected  class TableReport.GroupFooterCreator
           
protected  class TableReport.GroupHeaderCreator
           
protected  class TableReport.PageFooterCreator
           
protected  class TableReport.ReportBandCreator
           
protected  class TableReport.ReportBandInfo
           
protected  class TableReport.ReverseReportBandCreator
           
protected  class TableReport.SummaryCreator
           
protected  class TableReport.SummaryGroupFooterPrintWhenEvaluator
           
protected  class TableReport.TitleCreator
           
 
Field Summary
protected static java.lang.String HTML_CLASS_COLUMN
           
protected static java.lang.String HTML_CLASS_COLUMN_PREFIX
           
protected static java.lang.String SUMMARY_GROUP_NAME
           
protected static java.lang.String TABLE_SCRIPTLET_NAME
           
 
Fields inherited from interface net.sf.jasperreports.engine.JRReport
LANGUAGE_GROOVY, LANGUAGE_JAVA
 
Constructor Summary
TableReport(FillContext fillContext, TableComponent table, TableReportDataset mainDataset, java.util.List<FillColumn> fillColumns, java.util.Map<JRExpression,BuiltinExpressionEvaluator> builtinEvaluators)
           
 
Method Summary
protected  void addSummaryGroup(java.util.List<FillColumn> fillColumns)
           
protected  int computeTableWidth(java.util.List<FillColumn> fillColumns)
           
protected  JRDesignExpression createBuiltinExpression(BuiltinExpressionEvaluator evaluator)
           
protected  JRDesignFrame createCellFrame(Cell cell, int originalWidth, int width, int x, int y)
           
protected  JRDesignFrame createCellFrame(Cell cell, int originalWidth, int width, int x, int y, int columnHashCode)
           
protected  JRDesignBand createColumnHeader(java.util.List<FillColumn> fillColumns)
           
protected  JRBand createDetailBand(java.util.List<FillColumn> fillColumns)
           
protected  JRBand createGroupFooter(java.lang.String groupName, java.util.List<FillColumn> fillColumns)
           
protected  JRBand createGroupHeader(java.lang.String groupName, java.util.List<FillColumn> fillColumns)
           
protected  JRDesignBand createPageFooter(java.util.List<FillColumn> fillColumns)
           
protected  JRDesignBand createSummary(java.util.List<FillColumn> fillColumns)
           
protected  JRDesignBand createTitle(java.util.List<FillColumn> fillColumns)
           
 JRBand getBackground()
           
 int getBottomMargin()
           
 int getColumnCount()
          Gets the number of columns on each page
 RunDirectionEnum getColumnDirection()
          Specifies whether columns will be filled from left to right or from right to left.
 JRBand getColumnFooter()
           
 JRBand getColumnHeader()
           
 int getColumnSpacing()
          Specifies the space between columns on the same page.
 int getColumnWidth()
           
 JRDataset[] getDatasets()
          Returns the datasets of this report.
 JRStyle getDefaultStyle()
          Returns a default style.
 JRBand getDetail()
          Deprecated. 
 JRSection getDetailSection()
           
protected  JRField getField(java.lang.String name)
           
 JRField[] getFields()
           
 java.lang.String getFormatFactoryClass()
          Gets the name of the class implementing the FormatFactory interface to use with this report.
 JRGroup[] getGroups()
           
 java.lang.String[] getImports()
          Gets an array of imports (needed if report expression require additional classes in order to compile).
 java.lang.String getLanguage()
          Gets the report language.
 JRBand getLastPageFooter()
           
 int getLeftMargin()
           
 JRDataset getMainDataset()
          Returns the main report dataset.
 java.lang.String getName()
          Gets the report name.
 JRBand getNoData()
           
 OrientationEnum getOrientationValue()
          Specifies whether document pages will be rendered in a portrait or landscape layout.
 JRBand getPageFooter()
           
 JRBand getPageHeader()
           
 int getPageHeight()
           
 int getPageWidth()
           
 JRParameter[] getParameters()
           
 JRPropertiesHolder getParentProperties()
          Returns the parent properties holder, whose properties are used as defaults for this object.
 PrintOrderEnum getPrintOrderValue()
          Specifies whether columns will be filled horizontally or vertically.
 JRPropertiesMap getPropertiesMap()
          Returns this object's properties map.
 java.lang.String getProperty(java.lang.String name)
          Gets a property value
 java.lang.String[] getPropertyNames()
          Gets an array of report properties names.
 JRQuery getQuery()
           
 java.lang.String getResourceBundle()
          Gets the base name of the report associated resource bundle.
 int getRightMargin()
           
 java.lang.String getScriptletClass()
           
 JRScriptlet[] getScriptlets()
           
 JRSortField[] getSortFields()
           
 JRStyle[] getStyles()
          Gets an array of report styles.
 JRBand getSummary()
           
 JRReportTemplate[] getTemplates()
          Returns the list of report templates.
 JRBand getTitle()
           
 int getTopMargin()
           
 java.util.UUID getUUID()
           
protected  JRVariable getVariable(java.lang.String name)
           
 JRVariable[] getVariables()
           
 WhenNoDataTypeEnum getWhenNoDataTypeValue()
          Specifies the report behavior in case of empty datasources.
 WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue()
          Returns the resource missing handling type.
 boolean hasProperties()
          Checks whether the object has any properties.
 boolean isFloatColumnFooter()
          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 isIgnorePagination()
          Decides whether to use pagination when filling the report.
 boolean isSummaryNewPage()
          Specifies if the summary section will be printed on a separate last page.
 boolean isSummaryWithPageHeaderAndFooter()
          Specifies if the summary section will be accompanied by the page header and footer.
 boolean isTitleNewPage()
          Specifies if the title section will be printed on a separate initial page.
 void removeProperty(java.lang.String name)
           
protected  void scaleCellElement(JRElement element, java.lang.Integer cellWidth, int scaledCellWidth)
           
 void setProperty(java.lang.String name, java.lang.String value)
           
 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 wrapBand(JRBand band, JROrigin origin)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUMMARY_GROUP_NAME

protected static final java.lang.String SUMMARY_GROUP_NAME
See Also:
Constant Field Values

HTML_CLASS_COLUMN_PREFIX

protected static final java.lang.String HTML_CLASS_COLUMN_PREFIX
See Also:
Constant Field Values

HTML_CLASS_COLUMN

protected static final java.lang.String HTML_CLASS_COLUMN
See Also:
Constant Field Values

TABLE_SCRIPTLET_NAME

protected static final java.lang.String TABLE_SCRIPTLET_NAME
See Also:
Constant Field Values
Constructor Detail

TableReport

public TableReport(FillContext fillContext,
                   TableComponent table,
                   TableReportDataset mainDataset,
                   java.util.List<FillColumn> fillColumns,
                   java.util.Map<JRExpression,BuiltinExpressionEvaluator> builtinEvaluators)
Method Detail

createBuiltinExpression

protected JRDesignExpression createBuiltinExpression(BuiltinExpressionEvaluator evaluator)

createDetailBand

protected JRBand createDetailBand(java.util.List<FillColumn> fillColumns)

createColumnHeader

protected JRDesignBand createColumnHeader(java.util.List<FillColumn> fillColumns)

createPageFooter

protected JRDesignBand createPageFooter(java.util.List<FillColumn> fillColumns)

createTitle

protected JRDesignBand createTitle(java.util.List<FillColumn> fillColumns)

createSummary

protected JRDesignBand createSummary(java.util.List<FillColumn> fillColumns)

createGroupHeader

protected JRBand createGroupHeader(java.lang.String groupName,
                                   java.util.List<FillColumn> fillColumns)

createGroupFooter

protected JRBand createGroupFooter(java.lang.String groupName,
                                   java.util.List<FillColumn> fillColumns)

computeTableWidth

protected int computeTableWidth(java.util.List<FillColumn> fillColumns)

addSummaryGroup

protected void addSummaryGroup(java.util.List<FillColumn> fillColumns)

createCellFrame

protected JRDesignFrame createCellFrame(Cell cell,
                                        int originalWidth,
                                        int width,
                                        int x,
                                        int y)

createCellFrame

protected JRDesignFrame createCellFrame(Cell cell,
                                        int originalWidth,
                                        int width,
                                        int x,
                                        int y,
                                        int columnHashCode)

scaleCellElement

protected void scaleCellElement(JRElement element,
                                java.lang.Integer cellWidth,
                                int scaledCellWidth)

wrapBand

protected JRSection wrapBand(JRBand band,
                             JROrigin origin)

getBackground

public JRBand getBackground()
Specified by:
getBackground in interface JRReport

getBottomMargin

public int getBottomMargin()
Specified by:
getBottomMargin in interface JRReport

getColumnCount

public int getColumnCount()
Description copied from interface: JRReport
Gets the number of columns on each page

Specified by:
getColumnCount in interface JRReport

getColumnFooter

public JRBand getColumnFooter()
Specified by:
getColumnFooter in interface JRReport

getColumnHeader

public JRBand getColumnHeader()
Specified by:
getColumnHeader in interface JRReport

getColumnSpacing

public int getColumnSpacing()
Description copied from interface: JRReport
Specifies the space between columns on the same page.

Specified by:
getColumnSpacing in interface JRReport

getColumnWidth

public int getColumnWidth()
Specified by:
getColumnWidth in interface JRReport

getDatasets

public JRDataset[] getDatasets()
Description copied from interface: JRReport
Returns the datasets of this report.

Specified by:
getDatasets in interface JRReport
Returns:
the datasets of this report

getDetail

@Deprecated
public JRBand getDetail()
Deprecated. 


getDetailSection

public JRSection getDetailSection()
Specified by:
getDetailSection in interface JRReport

getFields

public JRField[] getFields()
Specified by:
getFields in interface JRReport

getField

protected JRField getField(java.lang.String name)

getFormatFactoryClass

public java.lang.String getFormatFactoryClass()
Description copied from interface: JRReport
Gets the name of the class implementing the FormatFactory interface to use with this report.

Specified by:
getFormatFactoryClass in interface JRReport

getGroups

public JRGroup[] getGroups()
Specified by:
getGroups in interface JRReport

getImports

public java.lang.String[] 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 interface JRReport

getLanguage

public java.lang.String getLanguage()
Description copied from interface: JRReport
Gets the report language. Should be Java or Groovy.

Specified by:
getLanguage in interface JRReport

getLastPageFooter

public JRBand getLastPageFooter()
Specified by:
getLastPageFooter in interface JRReport

getLeftMargin

public int getLeftMargin()
Specified by:
getLeftMargin in interface JRReport

getMainDataset

public JRDataset 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 interface JRReport
Returns:
the main report dataset

getName

public java.lang.String getName()
Description copied from interface: JRReport
Gets the report name.

Specified by:
getName in interface JRReport

getNoData

public JRBand getNoData()
Specified by:
getNoData in interface JRReport

getOrientationValue

public OrientationEnum getOrientationValue()
Description copied from interface: JRReport
Specifies whether document pages will be rendered in a portrait or landscape layout.

Specified by:
getOrientationValue in interface JRReport
Returns:
a value representing one of the orientation constants in OrientationEnum

getPageFooter

public JRBand getPageFooter()
Specified by:
getPageFooter in interface JRReport

getPageHeader

public JRBand getPageHeader()
Specified by:
getPageHeader in interface JRReport

getPageHeight

public int getPageHeight()
Specified by:
getPageHeight in interface JRReport

getPageWidth

public int getPageWidth()
Specified by:
getPageWidth in interface JRReport

getParameters

public JRParameter[] getParameters()
Specified by:
getParameters in interface JRReport

getPrintOrderValue

public PrintOrderEnum getPrintOrderValue()
Description copied from interface: JRReport
Specifies whether columns will be filled horizontally or vertically.

Specified by:
getPrintOrderValue in interface JRReport
Returns:
a value representing one of the print order constants in PrintOrderEnum

getColumnDirection

public RunDirectionEnum 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 interface JRReport
Returns:
a value representing one of the column direction constants in RunDirectionEnum

getProperty

public java.lang.String getProperty(java.lang.String name)
Description copied from interface: JRReport
Gets a property value

Specified by:
getProperty in interface JRReport
Parameters:
name - the property name

getPropertyNames

public java.lang.String[] getPropertyNames()
Description copied from interface: JRReport
Gets an array of report properties names.

Specified by:
getPropertyNames in interface JRReport

getQuery

public JRQuery getQuery()
Specified by:
getQuery in interface JRReport

getResourceBundle

public java.lang.String getResourceBundle()
Description copied from interface: JRReport
Gets the base name of the report associated resource bundle.

Specified by:
getResourceBundle in interface JRReport

getRightMargin

public int getRightMargin()
Specified by:
getRightMargin in interface JRReport

getScriptletClass

public java.lang.String getScriptletClass()
Specified by:
getScriptletClass in interface JRReport

getScriptlets

public JRScriptlet[] getScriptlets()
Specified by:
getScriptlets in interface JRReport

getSortFields

public JRSortField[] getSortFields()
Specified by:
getSortFields in interface JRReport

getStyles

public JRStyle[] getStyles()
Description copied from interface: JRReport
Gets an array of report styles.

Specified by:
getStyles in interface JRReport

getSummary

public JRBand getSummary()
Specified by:
getSummary in interface JRReport

getTemplates

public JRReportTemplate[] getTemplates()
Description copied from interface: JRReport
Returns the list of report templates.

A report template is an expression which resolves at runtime to a template. Templates include styles which can be used in the report.

The order in which the templates are included in the report is important:

Specified by:
getTemplates in interface JRReport
Returns:
the list of report templates, or null if none
See Also:
JRTemplate, JRParameter.REPORT_TEMPLATES

getTitle

public JRBand getTitle()
Specified by:
getTitle in interface JRReport

getTopMargin

public int getTopMargin()
Specified by:
getTopMargin in interface JRReport

getVariables

public JRVariable[] getVariables()
Specified by:
getVariables in interface JRReport

getVariable

protected JRVariable getVariable(java.lang.String name)

getWhenNoDataTypeValue

public WhenNoDataTypeEnum getWhenNoDataTypeValue()
Description copied from interface: JRReport
Specifies the report behavior in case of empty datasources.

Specified by:
getWhenNoDataTypeValue in interface JRReport

getWhenResourceMissingTypeValue

public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue()
Description copied from interface: JRReport
Returns the resource missing handling type.

Specified by:
getWhenResourceMissingTypeValue in interface JRReport

isFloatColumnFooter

public boolean isFloatColumnFooter()
Description copied from interface: JRReport
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.

Specified by:
isFloatColumnFooter in interface JRReport

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 interface JRReport
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 interface JRReport

isSummaryWithPageHeaderAndFooter

public boolean isSummaryWithPageHeaderAndFooter()
Description copied from interface: JRReport
Specifies if the summary section will be accompanied by the page header and footer.

Specified by:
isSummaryWithPageHeaderAndFooter in interface JRReport

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 interface JRReport

removeProperty

public void removeProperty(java.lang.String name)
Specified by:
removeProperty in interface JRReport

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Specified by:
setProperty in interface JRReport

setWhenNoDataType

public void setWhenNoDataType(WhenNoDataTypeEnum whenNoDataType)
Description copied from interface: JRReport
Sets the report behavior in case of empty datasources.

Specified by:
setWhenNoDataType in interface JRReport

setWhenResourceMissingType

public void setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType)
Description copied from interface: JRReport
Sets the resource missing handling type.

Specified by:
setWhenResourceMissingType in interface JRReport
Parameters:
whenResourceMissingType - the resource missing handling type

getDefaultStyle

public JRStyle getDefaultStyle()
Description copied from interface: JRDefaultStyleProvider
Returns a default style.

Specified by:
getDefaultStyle in interface JRDefaultStyleProvider

getParentProperties

public JRPropertiesHolder getParentProperties()
Description copied from interface: JRPropertiesHolder
Returns the parent properties holder, whose properties are used as defaults for this object.

Specified by:
getParentProperties in interface JRPropertiesHolder
Returns:
the parent properties holder, or null if no parent

getPropertiesMap

public JRPropertiesMap getPropertiesMap()
Description copied from interface: JRPropertiesHolder
Returns this object's properties map.

Specified by:
getPropertiesMap in interface JRPropertiesHolder
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 interface JRPropertiesHolder
Returns:
whether the object has any properties

getUUID

public java.util.UUID getUUID()
Specified by:
getUUID in interface JRIdentifiable


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com