Class AbstractReportDefinition

    • Constructor Detail

      • AbstractReportDefinition

        protected AbstractReportDefinition​(InstanceID id)
      • AbstractReportDefinition

        protected AbstractReportDefinition()
        Creates a new instance. This initializes all properties to their defaults - especially for subreports you have to set sensible values before you can use them later.
    • Method Detail

      • getResourceBundleFactory

        public ResourceBundleFactory getResourceBundleFactory()
        Returns the resource bundle factory for this report definition. The ResourceBundleFactory is used in internationalized reports to create the resourcebundles holding the localized resources.
        the assigned resource bundle factory.
      • setResourceBundleFactory

        public void setResourceBundleFactory​(ResourceBundleFactory resourceBundleFactory)
        Redefines the resource bundle factory for the report.
        resourceBundleFactory - the new resource bundle factory, never null.
        NullPointerException - if the given ResourceBundleFactory is null.
      • getPreProcessorCount

        public int getPreProcessorCount()
      • removePreProcessor

        public void removePreProcessor​(ReportPreProcessor preProcessor)
      • setRootGroup

        public void setRootGroup​(Group rootGroup)
      • setReportHeader

        public void setReportHeader​(ReportHeader header)
        Sets the report header.
        header - the report header (null not permitted).
      • setReportFooter

        public void setReportFooter​(ReportFooter footer)
        Sets the report footer.
        footer - the report footer (null not permitted).
      • setPageHeader

        public void setPageHeader​(PageHeader header)
        Sets the page header.
        header - the page header (null not permitted).
      • setPageFooter

        public void setPageFooter​(PageFooter footer)
        Sets the page footer.
        footer - the page footer (null not permitted).
      • setWatermark

        public void setWatermark​(Watermark band)
        Sets the watermark band for the report.
        band - the new watermark band (null not permitted).
      • getWatermark

        public Watermark getWatermark()
        Returns the report's watermark band.
        Specified by:
        getWatermark in interface ReportDefinition
        the watermark band (never null).
      • addGroup

        public void addGroup​(RelationalGroup group)
        Adds a group to the report. This replaces the group body on the group with a new data-group-body composed of the existing itemband and no-databand.
        group - the group.
      • addGroup

        public void addGroup​(CrosstabGroup group)
        Adds a crosstab group. This replaces any existing crosstabs and all the details sections.
        group -
      • getGroupCount

        public int getGroupCount()
        Returns the number of groups in this report.

        Every report has at least one group defined.

        Specified by:
        getGroupCount in interface ReportDefinition
        the group count.
      • getRelationalGroup

        public RelationalGroup getRelationalGroup​(int groupIndex)
      • 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 interface ReportDefinition
        groupIndex - the group index.
        the requested group.
        IllegalArgumentException - if the count is negative.
        IndexOutOfBoundsException - if the count is greater than the number of defined groups.
      • getGroupByName

        public RelationalGroup getGroupByName​(String name)
        Searches a group by its defined name. This method returns null, if the group was not found.
        name - the name of the group.
        the group or null if not found.
      • addExpression

        public void addExpression​(Expression function)
        Adds a function to the report's collection of expressions.
        function - the function.
      • setQueryTimeout

        public void setQueryTimeout​(int queryTimeout)
      • setQueryLimit

        public void setQueryLimit​(int queryLimit)
      • setQueryLimitInheritance

        public void setQueryLimitInheritance​(boolean queryLimitInheritance)
      • isQueryLimitInherited

        public boolean isQueryLimitInherited()
      • getUserQueryLimit

        public int getUserQueryLimit()
      • setUserQueryLimit

        public void setUserQueryLimit​(int queryLimit)
      • getQuery

        public String getQuery()
        Returns a new query or query-name that is used when retrieving the data from the data-factory.
        Specified by:
        getQuery in interface ReportDefinition
        the query-string.
      • setQuery

        public void setQuery​(String query)
        Defines a new query or query-name that is used when retrieving the data from the data-factory.
        query - the query-string.
        See Also:
        DataFactory.queryData(String, DataRow)
      • getExpressions

        public ExpressionCollection getExpressions()
        Returns the expressions for the report. When adding or removing expressions on the list, make sure to call "notifyStructureChanged" afterwards when in design-mode.
        the expressions.
      • setExpressions

        public void setExpressions​(ExpressionCollection expressions)
        Sets the expressions for the report.
        expressions - the expressions (null not permitted).
      • derive

        public AbstractReportDefinition derive​(boolean preserveElementInstanceIds)
        Description copied from class: Element
        Creates a deep copy of this element and regenerates all instance-ids.
        derive in class Section
        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.
        the copy of the element.
      • removeElement

        protected void removeElement​(Element element)
        Description copied from class: Section
        Removes an element from the section.
        Specified by:
        removeElement in class Section
        element - the element to be section.
      • getElementCount

        public int getElementCount()
        Description copied from class: Section
        Returns the number of elements in this section.
        Specified by:
        getElementCount in class Section
        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 class Section
        index - the element position within this section
        the element
      • setContentBase

        public void setContentBase​(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
        Defines the content base for the report. The content base will be used to resolve relative URLs during the report generation and resource loading. If there is no content base defined, it will be impossible to resolve relative paths.
        key - the content base or null.
      • getContentBase

        public org.pentaho.reporting.libraries.resourceloader.ResourceKey getContentBase()
        Returns the content base of this report. The content base is used to resolve relative URLs during the report generation and resource loading. If there is no content base defined, it will be impossible to resolve relative paths.
        getContentBase in class Element
        the content base or null, if no content base is defined.
      • setDefinitionSource

        public void setDefinitionSource​(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
      • getDefinitionSource

        public org.pentaho.reporting.libraries.resourceloader.ResourceKey getDefinitionSource()
        Description copied from class: Element
        Returns the resource-key of the file that defined this element. This method may return null if the whole report was created in memory.
        getDefinitionSource in class Element
        the the definition source.
      • getDataFactory

        public abstract DataFactory getDataFactory()
        Returns the data factory that has been assigned to this report. The data factory will never be null.
        the data factory.
      • setDataFactory

        public abstract void setDataFactory​(DataFactory dataFactory)
        Sets the data factory for the report.
        dataFactory - the data factory for the report, never null.
      • addReportModelListener

        public void addReportModelListener​(ReportModelListener listener)
      • removeReportModelListener

        public void removeReportModelListener​(ReportModelListener listener)
      • fireModelLayoutChanged

        public void fireModelLayoutChanged​(ReportElement node,
                                           int type,
                                           Object parameter)
      • getDatasourceChangeTracker

        public long getDatasourceChangeTracker()
      • getNonVisualsChangeTracker

        public long getNonVisualsChangeTracker()
      • removeExpression

        public void removeExpression​(Expression expression)
      • setDataSchemaDefinition

        public void setDataSchemaDefinition​(DataSchemaDefinition dataSchemaDefinition)
      • getResourceManager

        public abstract org.pentaho.reporting.libraries.resourceloader.ResourceManager getResourceManager()
        This method has only meaning for master-reports. This handle will be removed in the next majore release.
      • addStructureFunction

        public void addStructureFunction​(StructureFunction function)
        Adds a structural function to the report. Structural functions perform content preparation and maintainance operations before elements are layouted or printed.

        Structural function can live on their own processing level and are evaluated after the user expressions but before the layout expressions have been evaluated.

        function - the structure function.
      • getStructureFunctionCount

        public int getStructureFunctionCount()
        Returns the number of structural functions added to the report.
        the function count.
      • getStructureFunction

        public StructureFunction getStructureFunction​(int index)
        Returns the structure function at the given position.
        index - the position of the function in the list.
        the function, never null.
        IndexOutOfBoundsException - if the index is invalid.
      • removeStructureFunction

        public void removeStructureFunction​(StructureFunction f)
        Removes the given function from the collection of structure functions. This removes only the first occurence of the function, in case a function has been added twice.
        f - the function to be removed.
      • getStructureFunctions

        public StructureFunction[] getStructureFunctions()
        Returns a copy of all structure functions contained in the report. Modifying the function instances will not alter the functions contained in the report.
        the functions.
      • getDefaultStyleSheet

        public ElementStyleSheet getDefaultStyleSheet()
        Description copied from class: Section
        Creates the global stylesheet for this element type. The global stylesheet is an immutable stylesheet that provides reasonable default values for some of the style keys.

        The global default stylesheet is always the last stylesheet that will be queried for values.

        Specified by:
        getDefaultStyleSheet in interface ReportElement
        getDefaultStyleSheet in class Section
        the global stylesheet.
      • setAutoSort

        public void setAutoSort​(Boolean sort)
      • getAutoSort

        public Boolean getAutoSort()