Package net.sf.jasperreports.engine.base
Class JRBaseReport
- java.lang.Object
-
- net.sf.jasperreports.engine.base.JRBaseReport
-
- All Implemented Interfaces:
Serializable,JRChangeEventsSupport,JRDefaultStyleProvider,JRIdentifiable,JRPropertiesHolder,JRReport
- Direct Known Subclasses:
JasperDesign,JasperReport
public class JRBaseReport extends Object implements JRReport, Serializable, JRChangeEventsSupport
Base class that implements theJRReportinterface.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
JRReport, Serialized Form
-
-
Field Summary
-
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 voidcopyTemplates(JRReport report, JRBaseObjectFactory factory)JRBand[]getAllBands()JRBandgetBackground()intgetBottomMargin()intgetColumnCount()Gets the number of columns on each pageRunDirectionEnumgetColumnDirection()Specifies whether columns will be filled from left to right or from right to left.JRBandgetColumnFooter()JRBandgetColumnHeader()intgetColumnSpacing()Specifies the space between columns on the same page.intgetColumnWidth()JRDataset[]getDatasets()Returns the datasets of this report.JRStylegetDefaultStyle()Returns a default style.JRSectiongetDetailSection()JRPropertyChangeSupportgetEventSupport()Returns the property change support object for this instance.JRField[]getFields()Gets an array of report fields.StringgetFormatFactoryClass()Gets the name of the class implementing theFormatFactoryinterface to use with this report.JRGroup[]getGroups()String[]getImports()Gets an array of imports (needed if report expression require additional classes in order to compile).StringgetLanguage()Gets the report language.JRBandgetLastPageFooter()intgetLeftMargin()JRDatasetgetMainDataset()Returns the main report dataset.StringgetName()Gets the report name.JRBandgetNoData()OrientationEnumgetOrientationValue()Specifies whether document pages will be rendered in a portrait or landscape layout.JRBandgetPageFooter()JRBandgetPageHeader()intgetPageHeight()intgetPageWidth()JRParameter[]getParameters()Gets an array of report parameters (including built-in ones).JRPropertiesHoldergetParentProperties()Returns the parent properties holder, whose properties are used as defaults for this object.PrintOrderEnumgetPrintOrderValue()Specifies whether columns will be filled horizontally or vertically.JRPropertiesMapgetPropertiesMap()Returns this object's properties map.StringgetProperty(String propName)Gets a property valueDatasetPropertyExpression[]getPropertyExpressions()Returns the list of dynamic/expression-based properties for this report.String[]getPropertyNames()Gets an array of report properties names.JRQuerygetQuery()StringgetResourceBundle()Gets the base name of the report associated resource bundle.intgetRightMargin()StringgetScriptletClass()JRScriptlet[]getScriptlets()Gets an array of report scriptlets (excluding the scriptletClass one).SectionTypeEnumgetSectionType()Specifies whether report sections are made of bands or of parts.JRSortField[]getSortFields()Gets an array of sort report fields.StyleResolvergetStyleResolver()Returns a style resolver.JRStyle[]getStyles()Gets an array of report styles.JRBandgetSummary()JRReportTemplate[]getTemplates()Returns the list of report templates.JRBandgetTitle()intgetTopMargin()UUIDgetUUID()JRVariable[]getVariables()Gets an array of report variables.WhenNoDataTypeEnumgetWhenNoDataTypeValue()Specifies the report behavior in case of empty datasources.WhenResourceMissingTypeEnumgetWhenResourceMissingTypeValue()Returns the resource missing handling type.booleanhasProperties()Checks whether the object has any properties.booleanisFloatColumnFooter()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.booleanisIgnorePagination()Decides whether to use pagination when filling the report.booleanisSummaryNewPage()Specifies if the summary section will be printed on a separate last page.booleanisSummaryWithPageHeaderAndFooter()Specifies if the summary section will be accompanied by the page header and footer.booleanisTitleNewPage()Specifies if the title section will be printed on a separate initial page.voidremoveProperty(String propName)voidsetJasperReportsContext(JasperReportsContext jasperReportsContext)voidsetProperty(String propName, String value)voidsetSectionType(SectionTypeEnum sectionType)voidsetWhenNoDataType(WhenNoDataTypeEnum whenNoDataTypeValue)Sets the report behavior in case of empty datasources.voidsetWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType)Sets the resource missing handling type.
-
-
-
Field Detail
-
PROPERTY_WHEN_NO_DATA_TYPE
public static final String PROPERTY_WHEN_NO_DATA_TYPE
- See Also:
- Constant Field Values
-
PROPERTY_SECTION_TYPE
public static final String PROPERTY_SECTION_TYPE
- See Also:
- Constant Field Values
-
name
protected String name
-
language
protected 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 String formatFactoryClass
-
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)
-
getLanguage
public String getLanguage()
Description copied from interface:JRReportGets the report language. Should be Java or Groovy.- Specified by:
getLanguagein interfaceJRReport
-
getColumnCount
public int getColumnCount()
Description copied from interface:JRReportGets the number of columns on each page- Specified by:
getColumnCountin interfaceJRReport
-
getPrintOrderValue
public PrintOrderEnum getPrintOrderValue()
Description copied from interface:JRReportSpecifies whether columns will be filled horizontally or vertically.- Specified by:
getPrintOrderValuein interfaceJRReport- Returns:
- a value representing one of the print order constants in
PrintOrderEnum
-
getColumnDirection
public RunDirectionEnum 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
-
getPageWidth
public int getPageWidth()
- Specified by:
getPageWidthin interfaceJRReport
-
getPageHeight
public int getPageHeight()
- Specified by:
getPageHeightin interfaceJRReport
-
getOrientationValue
public OrientationEnum getOrientationValue()
Description copied from interface:JRReportSpecifies whether document pages will be rendered in a portrait or landscape layout.- Specified by:
getOrientationValuein interfaceJRReport- Returns:
- a value representing one of the orientation constants in
OrientationEnum
-
getWhenNoDataTypeValue
public WhenNoDataTypeEnum getWhenNoDataTypeValue()
Description copied from interface:JRReportSpecifies the report behavior in case of empty datasources.- Specified by:
getWhenNoDataTypeValuein interfaceJRReport
-
setWhenNoDataType
public void setWhenNoDataType(WhenNoDataTypeEnum whenNoDataTypeValue)
Description copied from interface:JRReportSets the report behavior in case of empty datasources.- Specified by:
setWhenNoDataTypein interfaceJRReport
-
getSectionType
public SectionTypeEnum 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
-
setSectionType
public void setSectionType(SectionTypeEnum sectionType)
-
getColumnWidth
public int getColumnWidth()
- Specified by:
getColumnWidthin interfaceJRReport
-
getColumnSpacing
public int getColumnSpacing()
Description copied from interface:JRReportSpecifies the space between columns on the same page.- Specified by:
getColumnSpacingin interfaceJRReport
-
getLeftMargin
public int getLeftMargin()
- Specified by:
getLeftMarginin interfaceJRReport
-
getRightMargin
public int getRightMargin()
- Specified by:
getRightMarginin interfaceJRReport
-
getTopMargin
public int getTopMargin()
- Specified by:
getTopMarginin interfaceJRReport
-
getBottomMargin
public int getBottomMargin()
- Specified by:
getBottomMarginin 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
-
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
-
isSummaryWithPageHeaderAndFooter
public boolean isSummaryWithPageHeaderAndFooter()
Description copied from interface:JRReportSpecifies if the summary section will be accompanied by the page header and footer.- Specified by:
isSummaryWithPageHeaderAndFooterin interfaceJRReport
-
isFloatColumnFooter
public boolean isFloatColumnFooter()
Description copied from interface:JRReportSpecifies 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:
isFloatColumnFooterin interfaceJRReport
-
getScriptletClass
public String getScriptletClass()
- Specified by:
getScriptletClassin interfaceJRReport
-
getFormatFactoryClass
public String getFormatFactoryClass()
Description copied from interface:JRReportGets the name of the class implementing theFormatFactoryinterface to use with this report.- Specified by:
getFormatFactoryClassin interfaceJRReport
-
getResourceBundle
public String getResourceBundle()
Description copied from interface:JRReportGets the base name of the report associated resource bundle.- Specified by:
getResourceBundlein interfaceJRReport
-
getPropertyNames
public String[] getPropertyNames()
Description copied from interface:JRReportGets an array of report properties names.- Specified by:
getPropertyNamesin interfaceJRReport
-
getProperty
public String getProperty(String propName)
Description copied from interface:JRReportGets a property value- Specified by:
getPropertyin interfaceJRReport- Parameters:
propName- the property name
-
setProperty
public void setProperty(String propName, String value)
- Specified by:
setPropertyin interfaceJRReport
-
removeProperty
public void removeProperty(String propName)
- Specified by:
removePropertyin interfaceJRReport
-
getPropertyExpressions
public DatasetPropertyExpression[] 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
-
getImports
public String[] 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
-
getDefaultStyle
public JRStyle getDefaultStyle()
Description copied from interface:JRDefaultStyleProviderReturns a default style.- Specified by:
getDefaultStylein interfaceJRDefaultStyleProvider
-
getStyles
public JRStyle[] getStyles()
Description copied from interface:JRReportGets an array of report styles.
-
getStyleResolver
public StyleResolver getStyleResolver()
Description copied from interface:JRDefaultStyleProviderReturns a style resolver.- Specified by:
getStyleResolverin interfaceJRDefaultStyleProvider
-
getScriptlets
public JRScriptlet[] getScriptlets()
Gets an array of report scriptlets (excluding the scriptletClass one).- Specified by:
getScriptletsin interfaceJRReport
-
getParameters
public JRParameter[] getParameters()
Gets an array of report parameters (including built-in ones).- Specified by:
getParametersin interfaceJRReport
-
getFields
public JRField[] getFields()
Gets an array of report fields.
-
getSortFields
public JRSortField[] getSortFields()
Gets an array of sort report fields.- Specified by:
getSortFieldsin interfaceJRReport
-
getVariables
public JRVariable[] getVariables()
Gets an array of report variables.- Specified by:
getVariablesin interfaceJRReport
-
getBackground
public JRBand getBackground()
- Specified by:
getBackgroundin interfaceJRReport
-
getPageHeader
public JRBand getPageHeader()
- Specified by:
getPageHeaderin interfaceJRReport
-
getColumnHeader
public JRBand getColumnHeader()
- Specified by:
getColumnHeaderin interfaceJRReport
-
getDetailSection
public JRSection getDetailSection()
- Specified by:
getDetailSectionin interfaceJRReport
-
getColumnFooter
public JRBand getColumnFooter()
- Specified by:
getColumnFooterin interfaceJRReport
-
getPageFooter
public JRBand getPageFooter()
- Specified by:
getPageFooterin interfaceJRReport
-
getLastPageFooter
public JRBand getLastPageFooter()
- Specified by:
getLastPageFooterin interfaceJRReport
-
getSummary
public JRBand getSummary()
- Specified by:
getSummaryin interfaceJRReport
-
getWhenResourceMissingTypeValue
public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue()
Description copied from interface:JRReportReturns the resource missing handling type.- Specified by:
getWhenResourceMissingTypeValuein interfaceJRReport
-
setWhenResourceMissingType
public void setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType)
Description copied from interface:JRReportSets the resource missing handling type.- Specified by:
setWhenResourceMissingTypein interfaceJRReport- Parameters:
whenResourceMissingType- the resource missing handling type
-
getMainDataset
public JRDataset 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
-
getDatasets
public JRDataset[] getDatasets()
Description copied from interface:JRReportReturns the datasets of this report.- Specified by:
getDatasetsin interfaceJRReport- Returns:
- the datasets of this report
-
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
-
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
-
getPropertiesMap
public JRPropertiesMap getPropertiesMap()
Description copied from interface:JRPropertiesHolderReturns this object's properties map.- Specified by:
getPropertiesMapin interfaceJRPropertiesHolder- Returns:
- this object's properties map
-
getParentProperties
public JRPropertiesHolder 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
-
getTemplates
public JRReportTemplate[] 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:
JRTemplate,JRParameter.REPORT_TEMPLATES
-
getNoData
public JRBand getNoData()
-
getAllBands
public JRBand[] getAllBands()
-
getUUID
public UUID getUUID()
- Specified by:
getUUIDin interfaceJRIdentifiable
-
getEventSupport
public JRPropertyChangeSupport getEventSupport()
Description copied from interface:JRChangeEventsSupportReturns the property change support object for this instance.- Specified by:
getEventSupportin interfaceJRChangeEventsSupport- Returns:
- the property change support object for this instance
-
-