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

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

        @Deprecated
        public void setResourceBundleFactory​(ResourceBundleFactory resourceBundleFactory)
        Deprecated.
        Redefines the resource bundle factory for the report.
        Parameters:
        resourceBundleFactory - the new resource bundle factory, never null.
        Throws:
        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.
        Parameters:
        header - the report header (null not permitted).
      • setReportFooter

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

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

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

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

        public Watermark getWatermark()
        Returns the report's watermark band.
        Specified by:
        getWatermark in interface ReportDefinition
        Returns:
        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.
        Parameters:
        group - the group.
      • addGroup

        public void addGroup​(CrosstabGroup group)
        Adds a crosstab group. This replaces any existing crosstabs and all the details sections.
        Parameters:
        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
        Returns:
        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
        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.
      • getGroupByName

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

        public void addExpression​(Expression function)
        Adds a function to the report's collection of expressions.
        Parameters:
        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
        Returns:
        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.
        Parameters:
        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.
        Returns:
        the expressions.
      • setExpressions

        public void setExpressions​(ExpressionCollection expressions)
        Sets the expressions for the report.
        Parameters:
        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.
        Overrides:
        derive in class Section
        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.
      • removeElement

        protected void removeElement​(Element element)
        Description copied from class: Section
        Removes an element from the section.
        Specified by:
        removeElement in class Section
        Parameters:
        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
        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 class Section
        Parameters:
        index - the element position within this section
        Returns:
        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.
        Parameters:
        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.
        Overrides:
        getContentBase in class Element
        Returns:
        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.
        Overrides:
        getDefinitionSource in class Element
        Returns:
        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.
        Returns:
        the data factory.
      • setDataFactory

        public abstract void setDataFactory​(DataFactory dataFactory)
        Sets the data factory for the report.
        Parameters:
        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

        @Deprecated
        public abstract org.pentaho.reporting.libraries.resourceloader.ResourceManager getResourceManager()
        Deprecated.
        This method has only meaning for master-reports. This handle will be removed in the next majore release.
        Returns:
      • 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.

        Parameters:
        function - the structure function.
      • getStructureFunctionCount

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

        public StructureFunction getStructureFunction​(int index)
        Returns the structure function at the given position.
        Parameters:
        index - the position of the function in the list.
        Returns:
        the function, never null.
        Throws:
        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.
        Parameters:
        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.
        Returns:
        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
        Overrides:
        getDefaultStyleSheet in class Section
        Returns:
        the global stylesheet.
      • setAutoSort

        public void setAutoSort​(Boolean sort)
      • getAutoSort

        public Boolean getAutoSort()