Class ReportDefinitionImpl
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.Element
-
- org.pentaho.reporting.engine.classic.core.Section
-
- org.pentaho.reporting.engine.classic.core.states.ReportDefinitionImpl
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Element>
,DataTarget
,ReportDefinition
,ReportElement
public class ReportDefinitionImpl extends Section implements ReportDefinition
A report definition. This the working copy of the JFreeReport object. This object is not serializable, as it is used internally. This implementation is not intended to be known outside. Whatever you planned to do with it - dont do it! Its only pupose is to be used and manipulated in the report states, there is no reason to do it outside.- Author:
- Thomas Morgner.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.pentaho.reporting.engine.classic.core.Element
ANONYMOUS_ELEMENT_PREFIX
-
-
Constructor Summary
Constructors Constructor Description ReportDefinitionImpl(MasterReport report, PageDefinition pageDefinition)
Creates a report definition from a report object.ReportDefinitionImpl(SubReport report, PageDefinition pageDefinition, Section parentSection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReportDefinitionImpl
clone()
Creates and returns a copy of this object.ReportDefinitionImpl
derive(boolean preserveElementInstanceIds)
Creates a deep copy of this element and regenerates all instance-ids.CrosstabCellBody
getCrosstabCellBody()
DetailsFooter
getDetailsFooter()
Returns the details header band.DetailsHeader
getDetailsHeader()
Returns the details header band.Element
getElement(int index)
Returns the element stored add the given index.int
getElementCount()
Returns the number of elements in this section.Group
getGroup(int groupIndex)
Returns the group at the specified index or null, if there is no such group.int
getGroupCount()
Returns the number of groups in this report.ItemBand
getItemBand()
Returns the item band.ReportDefinition
getMasterReport()
Returns the master-report element.NoDataBand
getNoDataBand()
Returns the "no-data" band, which is displayed if there is no data available.PageDefinition
getPageDefinition()
Returns the page definition assigned to the report definition.PageFooter
getPageFooter()
Returns the page footer.PageHeader
getPageHeader()
Returns the page header.String
getQuery()
Returns the query name that should be used when processing the report.int
getQueryLimit()
int
getQueryTimeout()
ReportDefinition
getReportDefinition()
Returns the currently assigned report definition.ReportFooter
getReportFooter()
Returns the report footer.ReportHeader
getReportHeader()
Returns the report header.Group
getRootGroup()
Returns the list of groups for the report.Watermark
getWatermark()
Returns the watermark band.protected void
removeElement(Element element)
Removes an element from the section.void
setElementAt(int position, Element element)
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.Section
getDefaultStyleSheet, iterator, registerAsChild, unregisterAsChild, unregisterParent, validateLooping
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.Element
copyAttributes, copyInto, derive, getAttribute, getAttributeExpression, getAttributeExpressionNames, getAttributeExpressionNamespaces, getAttributeExpressions, getAttributeNames, getAttributeNamespaces, getAttributes, getAttributeTyped, getChangeTracker, getChildElementByType, getChildElementsByName, getChildElementsByType, getComputedStyle, getContentBase, getDataSource, getDefinitionSource, getElementContext, getElementType, getElementTypeName, getFirstAttribute, getHRefTarget, getId, getMetaData, getName, getObjectID, getParent, getParentSection, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, isDynamicContent, isVisible, notifyElement, notifyNodeChildAdded, notifyNodeChildRemoved, notifyNodePropertiesChanged, notifyNodePropertiesChanged, notifyNodeStructureChanged, setAttribute, setAttribute, setAttributeExpression, setChangeTracker, setComputedStyle, setDataSource, setDynamicContent, setElementType, setHRefTarget, setId, setName, setParent, setStyleExpression, setVisible, toString, updateChangedFlagInternal, updateInternalChangeFlag
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.ReportElement
getAttribute, getAttributeExpression, getAttributeExpressionNames, getAttributeExpressionNamespaces, getAttributeNames, getAttributeNamespaces, getAttributes, getAttributeTyped, getChangeTracker, getChildElementByType, getChildElementsByName, getChildElementsByType, getComputedStyle, getDefaultStyleSheet, getElementContext, getElementType, getFirstAttribute, getId, getMetaData, getName, getObjectID, getParentSection, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, setAttribute, setAttribute, setAttributeExpression, setComputedStyle, setStyleExpression
-
-
-
-
Constructor Detail
-
ReportDefinitionImpl
public ReportDefinitionImpl(MasterReport report, PageDefinition pageDefinition) throws ReportProcessingException
Creates a report definition from a report object.- Parameters:
report
- the report.pageDefinition
- the current page definition.- Throws:
ReportProcessingException
- if there is a problem cloning.
-
ReportDefinitionImpl
public ReportDefinitionImpl(SubReport report, PageDefinition pageDefinition, Section parentSection) throws ReportProcessingException
- Throws:
ReportProcessingException
-
-
Method Detail
-
getQueryLimit
public int getQueryLimit()
- Specified by:
getQueryLimit
in interfaceReportDefinition
-
getQueryTimeout
public int getQueryTimeout()
- Specified by:
getQueryTimeout
in interfaceReportDefinition
-
getQuery
public String getQuery()
Description copied from interface:ReportDefinition
Returns the query name that should be used when processing the report.- Specified by:
getQuery
in interfaceReportDefinition
- Returns:
- the query string.
-
getReportHeader
public ReportHeader getReportHeader()
Returns the report header.- Specified by:
getReportHeader
in interfaceReportDefinition
- Returns:
- The report header.
-
getReportFooter
public ReportFooter getReportFooter()
Returns the report footer.- Specified by:
getReportFooter
in interfaceReportDefinition
- Returns:
- The report footer.
-
getPageHeader
public PageHeader getPageHeader()
Returns the page header.- Specified by:
getPageHeader
in interfaceReportDefinition
- Returns:
- The page header.
-
getPageFooter
public PageFooter getPageFooter()
Returns the page footer.- Specified by:
getPageFooter
in interfaceReportDefinition
- Returns:
- The page footer.
-
getItemBand
public ItemBand getItemBand()
Returns the item band.- Specified by:
getItemBand
in interfaceReportDefinition
- Returns:
- The item band.
-
getCrosstabCellBody
public CrosstabCellBody getCrosstabCellBody()
- Specified by:
getCrosstabCellBody
in interfaceReportDefinition
-
getDetailsHeader
public DetailsHeader getDetailsHeader()
Returns the details header band.- Specified by:
getDetailsHeader
in interfaceReportDefinition
- Returns:
- The details header band.
-
getDetailsFooter
public DetailsFooter getDetailsFooter()
Returns the details header band.- Specified by:
getDetailsFooter
in interfaceReportDefinition
- Returns:
- The details header band.
-
getRootGroup
public Group getRootGroup()
Description copied from interface:ReportDefinition
Returns the list of groups for the report.- Specified by:
getRootGroup
in interfaceReportDefinition
- Returns:
- The list of groups.
-
getNoDataBand
public NoDataBand getNoDataBand()
Returns the "no-data" band, which is displayed if there is no data available.- Specified by:
getNoDataBand
in interfaceReportDefinition
- Returns:
- The no-data band.
-
getGroupCount
public int getGroupCount()
Returns the number of groups in this report.Every report has at least one group defined.
- Specified by:
getGroupCount
in interfaceReportDefinition
- Returns:
- the group count.
-
getGroup
public Group getGroup(int groupIndex)
Returns the group at the specified index or null, if there is no such group.- Specified by:
getGroup
in interfaceReportDefinition
- Parameters:
groupIndex
- the group index.- Returns:
- the requested group.
- Throws:
IllegalArgumentException
- if the count is negative.IndexOutOfBoundsException
- if the count is greater than the number of defined groups.
-
clone
public ReportDefinitionImpl clone()
Creates and returns a copy of this object.- Specified by:
clone
in interfaceDataTarget
- Overrides:
clone
in classSection
- Returns:
- a clone of this instance.
- Throws:
CloneNotSupportedException
- if the object's class does not support theCloneable
interface. Subclasses that override theclone
method can also throw this exception to indicate that an instance cannot be cloned.- See Also:
Cloneable
-
derive
public ReportDefinitionImpl derive(boolean preserveElementInstanceIds)
Description copied from class:Element
Creates a deep copy of this element and regenerates all instance-ids.- Overrides:
derive
in classSection
- Parameters:
preserveElementInstanceIds
- defines whether this call generates new instance-ids for the derived elements. Instance-IDs are used by the report processor to recognize reoccurring elements and must not changed within the report run. Outside of the report processors new instance ids should be generated at all times to separate instances and to make them uniquely identifiable.- Returns:
- the copy of the element.
-
getWatermark
public Watermark getWatermark()
Description copied from interface:ReportDefinition
Returns the watermark band.- Specified by:
getWatermark
in interfaceReportDefinition
- Returns:
- The watermark band.
-
getPageDefinition
public PageDefinition getPageDefinition()
Description copied from interface:ReportDefinition
Returns the page definition assigned to the report definition. The page definition defines the report area and how the report is subdivided by the child pages.- Specified by:
getPageDefinition
in interfaceReportDefinition
- Returns:
- the page definition.
-
getReportDefinition
public ReportDefinition getReportDefinition()
Returns the currently assigned report definition.- Specified by:
getReportDefinition
in interfaceReportElement
- Overrides:
getReportDefinition
in classElement
- Returns:
- the report definition or null, if no report has been assigned.
-
getMasterReport
public ReportDefinition getMasterReport()
Description copied from class:Element
Returns the master-report element. This will be a MasterReport while outside of the report processing. Inside the report processing (when called from a report-definition contained in a report-state), this will be a ReportDefinitionImpl.- Overrides:
getMasterReport
in classElement
- Returns:
- the master report.
-
removeElement
protected void removeElement(Element element)
Description copied from class:Section
Removes an element from the section.- Specified by:
removeElement
in classSection
- Parameters:
element
- the element to be section.
-
setElementAt
public void setElementAt(int position, Element element)
- Specified by:
setElementAt
in classSection
-
getElementCount
public int getElementCount()
Description copied from class:Section
Returns the number of elements in this section.- Specified by:
getElementCount
in classSection
- Returns:
- the number of elements of this section.
-
getElement
public Element getElement(int index)
Description copied from class:Section
Returns the element stored add the given index.- Specified by:
getElement
in classSection
- Parameters:
index
- the element position within this section- Returns:
- the element
-
-