Package net.sf.jasperreports.engine.base
Class JRBaseReport
- java.lang.Object
-
- net.sf.jasperreports.engine.base.JRBaseReport
-
- All Implemented Interfaces:
java.io.Serializable
,JRChangeEventsSupport
,JRDefaultStyleProvider
,JRIdentifiable
,JRPropertiesHolder
,JRReport
- Direct Known Subclasses:
JasperDesign
,JasperReport
public class JRBaseReport extends java.lang.Object implements JRReport, java.io.Serializable, JRChangeEventsSupport
Base class that implements theJRReport
interface.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
JRReport
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected JRBand
background
protected int
bottomMargin
protected int
columnCount
protected RunDirectionEnum
columnDirection
protected JRBand
columnFooter
protected JRBand
columnHeader
protected int
columnSpacing
protected int
columnWidth
protected JRDataset[]
datasets
Sub datasets of the report.protected JRStyle
defaultStyle
protected JRSection
detailSection
protected java.lang.String
formatFactoryClass
protected boolean
ignorePagination
protected java.util.Set<java.lang.String>
importsSet
protected boolean
isFloatColumnFooter
protected boolean
isSummaryNewPage
protected boolean
isSummaryWithPageHeaderAndFooter
protected boolean
isTitleNewPage
protected java.lang.String
language
protected JRBand
lastPageFooter
protected int
leftMargin
protected JRDataset
mainDataset
The main dataset of the report.protected java.lang.String
name
protected JRBand
noData
protected OrientationEnum
orientationValue
protected JRBand
pageFooter
protected JRBand
pageHeader
protected int
pageHeight
protected int
pageWidth
protected PrintOrderEnum
printOrderValue
static java.lang.String
PROPERTY_SECTION_TYPE
static java.lang.String
PROPERTY_WHEN_NO_DATA_TYPE
protected int
rightMargin
protected SectionTypeEnum
sectionType
protected StyleResolver
styleResolver
protected JRStyle[]
styles
protected JRBand
summary
protected JRReportTemplate[]
templates
Report templates.protected JRBand
title
protected int
topMargin
protected WhenNoDataTypeEnum
whenNoDataTypeValue
-
Fields inherited from interface net.sf.jasperreports.engine.JRReport
CONFIG_PROPERTY_WHEN_NO_DATA_TYPE, LANGUAGE_GROOVY, LANGUAGE_JAVA
-
-
Constructor Summary
Constructors Constructor Description JRBaseReport()
Deprecated.Replaced byJasperDesign()
.JRBaseReport(JRReport report)
JRBaseReport(JRReport report, JRBaseObjectFactory factory)
Constructs a copy of a report.JRBaseReport(JRReport report, JRExpressionCollector expressionCollector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
copyTemplates(JRReport report, JRBaseObjectFactory factory)
JRBand[]
getAllBands()
JRBand
getBackground()
int
getBottomMargin()
int
getColumnCount()
Gets the number of columns on each pageRunDirectionEnum
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.JRSection
getDetailSection()
JRPropertyChangeSupport
getEventSupport()
Returns the property change support object for this instance.JRField[]
getFields()
Gets an array of report fields.java.lang.String
getFormatFactoryClass()
Gets the name of the class implementing theFormatFactory
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()
Gets an array of report parameters (including built-in ones).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 propName)
Gets a property valueDatasetPropertyExpression[]
getPropertyExpressions()
Returns the list of dynamic/expression-based properties for this report.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()
Gets an array of report scriptlets (excluding the scriptletClass one).SectionTypeEnum
getSectionType()
Specifies whether report sections are made of bands or of parts.JRSortField[]
getSortFields()
Gets an array of sort report fields.StyleResolver
getStyleResolver()
Returns a style resolver.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()
JRVariable[]
getVariables()
Gets an array of report variables.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 propName)
void
setJasperReportsContext(JasperReportsContext jasperReportsContext)
void
setProperty(java.lang.String propName, java.lang.String value)
void
setSectionType(SectionTypeEnum sectionType)
void
setWhenNoDataType(WhenNoDataTypeEnum whenNoDataTypeValue)
Sets the report behavior in case of empty datasources.void
setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType)
Sets the resource missing handling type.
-
-
-
Field Detail
-
PROPERTY_WHEN_NO_DATA_TYPE
public static final java.lang.String PROPERTY_WHEN_NO_DATA_TYPE
- See Also:
- Constant Field Values
-
PROPERTY_SECTION_TYPE
public static final java.lang.String PROPERTY_SECTION_TYPE
- See Also:
- Constant Field Values
-
name
protected java.lang.String name
-
language
protected java.lang.String language
-
columnCount
protected int columnCount
-
printOrderValue
protected PrintOrderEnum printOrderValue
-
columnDirection
protected RunDirectionEnum columnDirection
-
pageWidth
protected int pageWidth
-
pageHeight
protected int pageHeight
-
orientationValue
protected OrientationEnum orientationValue
-
whenNoDataTypeValue
protected WhenNoDataTypeEnum whenNoDataTypeValue
-
sectionType
protected SectionTypeEnum sectionType
-
columnWidth
protected int columnWidth
-
columnSpacing
protected int columnSpacing
-
leftMargin
protected int leftMargin
-
rightMargin
protected int rightMargin
-
topMargin
protected int topMargin
-
bottomMargin
protected int bottomMargin
-
isTitleNewPage
protected boolean isTitleNewPage
-
isSummaryNewPage
protected boolean isSummaryNewPage
-
isSummaryWithPageHeaderAndFooter
protected boolean isSummaryWithPageHeaderAndFooter
-
isFloatColumnFooter
protected boolean isFloatColumnFooter
-
ignorePagination
protected boolean ignorePagination
-
formatFactoryClass
protected java.lang.String formatFactoryClass
-
importsSet
protected java.util.Set<java.lang.String> importsSet
-
templates
protected JRReportTemplate[] templates
Report templates.
-
defaultStyle
protected JRStyle defaultStyle
-
styles
protected JRStyle[] styles
-
styleResolver
protected transient StyleResolver styleResolver
-
mainDataset
protected JRDataset mainDataset
The main dataset of the report.
-
datasets
protected JRDataset[] datasets
Sub datasets of the report.
-
background
protected JRBand background
-
title
protected JRBand title
-
pageHeader
protected JRBand pageHeader
-
columnHeader
protected JRBand columnHeader
-
detailSection
protected JRSection detailSection
-
columnFooter
protected JRBand columnFooter
-
pageFooter
protected JRBand pageFooter
-
lastPageFooter
protected JRBand lastPageFooter
-
summary
protected JRBand summary
-
noData
protected JRBand noData
-
-
Constructor Detail
-
JRBaseReport
public JRBaseReport()
Deprecated.Replaced byJasperDesign()
.
-
JRBaseReport
public JRBaseReport(JRReport report, JRExpressionCollector expressionCollector)
-
JRBaseReport
public JRBaseReport(JRReport report, JRBaseObjectFactory factory)
Constructs a copy of a report.
-
JRBaseReport
public JRBaseReport(JRReport report)
-
-
Method Detail
-
copyTemplates
protected void copyTemplates(JRReport report, JRBaseObjectFactory factory)
-
setJasperReportsContext
public void setJasperReportsContext(JasperReportsContext jasperReportsContext)
-
getName
public java.lang.String getName()
Description copied from interface:JRReport
Gets the report name.
-
getLanguage
public java.lang.String getLanguage()
Description copied from interface:JRReport
Gets the report language. Should be Java or Groovy.- Specified by:
getLanguage
in interfaceJRReport
-
getColumnCount
public int getColumnCount()
Description copied from interface:JRReport
Gets the number of columns on each page- Specified by:
getColumnCount
in interfaceJRReport
-
getPrintOrderValue
public PrintOrderEnum getPrintOrderValue()
Description copied from interface:JRReport
Specifies whether columns will be filled horizontally or vertically.- Specified by:
getPrintOrderValue
in interfaceJRReport
- 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 interfaceJRReport
- Returns:
- a value representing one of the column direction constants in
RunDirectionEnum
-
getPageWidth
public int getPageWidth()
- Specified by:
getPageWidth
in interfaceJRReport
-
getPageHeight
public int getPageHeight()
- Specified by:
getPageHeight
in interfaceJRReport
-
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 interfaceJRReport
- Returns:
- a value representing one of the orientation constants in
OrientationEnum
-
getWhenNoDataTypeValue
public WhenNoDataTypeEnum getWhenNoDataTypeValue()
Description copied from interface:JRReport
Specifies the report behavior in case of empty datasources.- Specified by:
getWhenNoDataTypeValue
in interfaceJRReport
-
setWhenNoDataType
public void setWhenNoDataType(WhenNoDataTypeEnum whenNoDataTypeValue)
Description copied from interface:JRReport
Sets the report behavior in case of empty datasources.- Specified by:
setWhenNoDataType
in interfaceJRReport
-
getSectionType
public SectionTypeEnum 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
-
setSectionType
public void setSectionType(SectionTypeEnum sectionType)
-
getColumnWidth
public int getColumnWidth()
- Specified by:
getColumnWidth
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
-
getLeftMargin
public int getLeftMargin()
- Specified by:
getLeftMargin
in interfaceJRReport
-
getRightMargin
public int getRightMargin()
- Specified by:
getRightMargin
in interfaceJRReport
-
getTopMargin
public int getTopMargin()
- Specified by:
getTopMargin
in interfaceJRReport
-
getBottomMargin
public int getBottomMargin()
- Specified by:
getBottomMargin
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
-
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
-
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 interfaceJRReport
-
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 interfaceJRReport
-
getScriptletClass
public java.lang.String getScriptletClass()
- Specified by:
getScriptletClass
in interfaceJRReport
-
getFormatFactoryClass
public java.lang.String 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
-
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 interfaceJRReport
-
getPropertyNames
public java.lang.String[] getPropertyNames()
Description copied from interface:JRReport
Gets an array of report properties names.- Specified by:
getPropertyNames
in interfaceJRReport
-
getProperty
public java.lang.String getProperty(java.lang.String propName)
Description copied from interface:JRReport
Gets a property value- Specified by:
getProperty
in interfaceJRReport
- Parameters:
propName
- the property name
-
setProperty
public void setProperty(java.lang.String propName, java.lang.String value)
- Specified by:
setProperty
in interfaceJRReport
-
removeProperty
public void removeProperty(java.lang.String propName)
- Specified by:
removeProperty
in interfaceJRReport
-
getPropertyExpressions
public DatasetPropertyExpression[] 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
-
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 interfaceJRReport
-
getDefaultStyle
public JRStyle getDefaultStyle()
Description copied from interface:JRDefaultStyleProvider
Returns a default style.- Specified by:
getDefaultStyle
in interfaceJRDefaultStyleProvider
-
getStyles
public JRStyle[] getStyles()
Description copied from interface:JRReport
Gets an array of report styles.
-
getStyleResolver
public StyleResolver getStyleResolver()
Description copied from interface:JRDefaultStyleProvider
Returns a style resolver.- Specified by:
getStyleResolver
in interfaceJRDefaultStyleProvider
-
getScriptlets
public JRScriptlet[] getScriptlets()
Gets an array of report scriptlets (excluding the scriptletClass one).- Specified by:
getScriptlets
in interfaceJRReport
-
getParameters
public JRParameter[] getParameters()
Gets an array of report parameters (including built-in ones).- Specified by:
getParameters
in interfaceJRReport
-
getFields
public JRField[] getFields()
Gets an array of report fields.
-
getSortFields
public JRSortField[] getSortFields()
Gets an array of sort report fields.- Specified by:
getSortFields
in interfaceJRReport
-
getVariables
public JRVariable[] getVariables()
Gets an array of report variables.- Specified by:
getVariables
in interfaceJRReport
-
getBackground
public JRBand getBackground()
- Specified by:
getBackground
in interfaceJRReport
-
getPageHeader
public JRBand getPageHeader()
- Specified by:
getPageHeader
in interfaceJRReport
-
getColumnHeader
public JRBand getColumnHeader()
- Specified by:
getColumnHeader
in interfaceJRReport
-
getDetailSection
public JRSection getDetailSection()
- Specified by:
getDetailSection
in interfaceJRReport
-
getColumnFooter
public JRBand getColumnFooter()
- Specified by:
getColumnFooter
in interfaceJRReport
-
getPageFooter
public JRBand getPageFooter()
- Specified by:
getPageFooter
in interfaceJRReport
-
getLastPageFooter
public JRBand getLastPageFooter()
- Specified by:
getLastPageFooter
in interfaceJRReport
-
getSummary
public JRBand getSummary()
- Specified by:
getSummary
in interfaceJRReport
-
getWhenResourceMissingTypeValue
public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue()
Description copied from interface:JRReport
Returns the resource missing handling type.- Specified by:
getWhenResourceMissingTypeValue
in interfaceJRReport
-
setWhenResourceMissingType
public void setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType)
Description copied from interface:JRReport
Sets the resource missing handling type.- Specified by:
setWhenResourceMissingType
in interfaceJRReport
- Parameters:
whenResourceMissingType
- the resource missing handling type
-
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 interfaceJRReport
- Returns:
- the main report dataset
-
getDatasets
public JRDataset[] getDatasets()
Description copied from interface:JRReport
Returns the datasets of this report.- Specified by:
getDatasets
in interfaceJRReport
- Returns:
- the datasets of this report
-
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
-
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
-
getPropertiesMap
public JRPropertiesMap getPropertiesMap()
Description copied from interface:JRPropertiesHolder
Returns this object's properties map.- Specified by:
getPropertiesMap
in interfaceJRPropertiesHolder
- Returns:
- this object's properties map
-
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 interfaceJRPropertiesHolder
- Returns:
- the parent properties holder, or
null
if no parent
-
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 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:
JRTemplate
,JRParameter.REPORT_TEMPLATES
-
getNoData
public JRBand getNoData()
-
getAllBands
public JRBand[] getAllBands()
-
getUUID
public java.util.UUID getUUID()
- Specified by:
getUUID
in interfaceJRIdentifiable
-
getEventSupport
public JRPropertyChangeSupport getEventSupport()
Description copied from interface:JRChangeEventsSupport
Returns the property change support object for this instance.- Specified by:
getEventSupport
in interfaceJRChangeEventsSupport
- Returns:
- the property change support object for this instance
-
-