Class ReportComponent

  • All Implemented Interfaces:
    NodeParser, com.inet.report.ReferenceHolder, java.io.Serializable
    Direct Known Subclasses:
    CrossTabDescriptionSection, Element, Region

    public abstract class ReportComponent
    extends java.lang.Object
    implements java.io.Serializable, com.inet.report.ReferenceHolder, NodeParser
    This is the base class of all report components. Report components are the structure components of a report. There are 2 types of components:
    • the container components like area and section
    • the visible elements like fields
    Since:
    7.0
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addPropertyChangeListener​(java.beans.PropertyChangeListener pcl)
      FOR INTERNAL USE ONLY
      void addPropertyChangeListener​(java.lang.String property, java.beans.PropertyChangeListener pcl)
      FOR INTERNAL USE ONLY
      void addReferencedObject​(com.inet.report.ReferencedObject reference)
      FOR INTERNAL USE ONLY
      void addVetoableChangeListener​(java.beans.VetoableChangeListener pcl)
      FOR INTERNAL USE ONLY
      void addVetoableChangeListener​(java.lang.String property, java.beans.VetoableChangeListener pcl)
      FOR INTERNAL USE ONLY
      int getBackColor()
      Returns the background color of this report element as ABGR, i.e. 0x000000FF for red.
      FormulaField getBackColorFormula()
      Returns the background color formula of this report element.
      java.lang.Object getCustomData()
      FOR INTERNAL USE ONLY Returns the custom data of this report component.
      int getHeight()
      Returns the height of this report element.
      FormulaField getKeepTogetherFormula()
      Returns the formula for the property 'keep together'.
      java.util.List<FormulaField> getPropertyFormulas()
      Returns a list with all property formulas that are set for this report element.
      int getRealReferencedObjectCount()
      FOR INTERNAL USE ONLY
      int getReferencedObjectCount()
      FOR INTERNAL USE ONLY
      com.inet.report.ReferencedObject[] getReferencedObjects()
      FOR INTERNAL USE ONLY
      abstract java.util.List<? extends ReportComponent> getSubComponents()
      Returns all ReportComponents that are descendants of this one.
      FormulaField getSuppressFormula()
      Returns the formula for the property 'suppress'.
      int getType()
      Returns the type of this report element.
      int getWidth()
      Returns the width of this report element.
      int getX()
      Returns the x position of the left upper corner of the element in the report.
      int getY()
      Returns the y position of the left upper corner of the element in the report.
      abstract int indexOf()
      Returns the position of this object in the parent collection.
      boolean isDOMParser()
      FOR INTERNAL USE ONLY Internal method for reading report XML
      boolean isKeepTogether()
      Returns the value of the property 'keep together'.
      boolean isSuppress()
      Returns the value of the property 'suppress'.
      java.lang.String paramString()
      Returns a string identifying this report component.
      void parseDOM​(org.w3c.dom.Node node, java.util.Map<java.lang.String,​java.lang.Object> parserMap)
      FOR INTERNAL USE ONLY Internal method for reading report XML
      NodeParser parseElement​(com.inet.report.parser.XMLTag group, java.lang.String tag, org.xml.sax.Attributes atts, java.util.Map<java.lang.String,​java.lang.Object> parserMap)
      FOR INTERNAL USE ONLY Internal method for reading report XML
      void parseEndElement​(com.inet.report.parser.XMLTag group, java.lang.String tag, java.util.Map<java.lang.String,​java.lang.Object> parserMap)
      FOR INTERNAL USE ONLY Internal method for reading report XML
      void parseText​(java.lang.String text, java.util.Map<java.lang.String,​java.lang.Object> parserMap)
      FOR INTERNAL USE ONLY Internal method for reading report XML
      void removePropertyChangeListener​(java.beans.PropertyChangeListener pcl)
      FOR INTERNAL USE ONLY
      void removePropertyChangeListener​(java.lang.String property, java.beans.PropertyChangeListener pcl)
      FOR INTERNAL USE ONLY
      void removeReferencedObject​(com.inet.report.ReferencedObject reference)
      FOR INTERNAL USE ONLY
      void removeVetoableChangeListener​(java.beans.VetoableChangeListener pcl)
      FOR INTERNAL USE ONLY
      void removeVetoableChangeListener​(java.lang.String property, java.beans.VetoableChangeListener pcl)
      FOR INTERNAL USE ONLY
      void resetReferences()
      FOR INTERNAL USE ONLY
      void setBackColor​(int backColor)
      Sets the background color of this report element.
      void setBackColorFormula​(FormulaField newFormula)
      Sets the background color of this report element.
      void setCustomData​(java.lang.Object customData)
      FOR INTERNAL USE ONLY Sets the custom data for this report component.
      void setHeight​(int height)
      Sets the height of this report element.
      void setKeepTogether​(boolean newValue)
      Sets the value of the property 'keep together'.
      void setKeepTogetherFormula​(FormulaField newFormula)
      Sets the formula for the property 'keep together'.
      void setReferences()
      FOR INTERNAL USE ONLY
      void setSuppress​(boolean newValue)
      Sets the value of the property 'suppress'.
      void setSuppressFormula​(FormulaField newFormula)
      Sets the formula for the property 'suppress'.
      void setWidth​(int width)
      Sets the width of this report element.
      void setX​(int x)
      Sets the x position of the left upper corner of the element in the report.
      void setY​(int y)
      Sets the y position of the left upper corner of the element in the report.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • addPropertyChangeListener

        public void addPropertyChangeListener​(java.beans.PropertyChangeListener pcl)
        FOR INTERNAL USE ONLY
      • addPropertyChangeListener

        public void addPropertyChangeListener​(java.lang.String property,
                                              java.beans.PropertyChangeListener pcl)
        FOR INTERNAL USE ONLY
      • addVetoableChangeListener

        public void addVetoableChangeListener​(java.beans.VetoableChangeListener pcl)
        FOR INTERNAL USE ONLY
      • addVetoableChangeListener

        public void addVetoableChangeListener​(java.lang.String property,
                                              java.beans.VetoableChangeListener pcl)
        FOR INTERNAL USE ONLY
      • removePropertyChangeListener

        public void removePropertyChangeListener​(java.lang.String property,
                                                 java.beans.PropertyChangeListener pcl)
        FOR INTERNAL USE ONLY
      • removePropertyChangeListener

        public void removePropertyChangeListener​(java.beans.PropertyChangeListener pcl)
        FOR INTERNAL USE ONLY
      • removeVetoableChangeListener

        public void removeVetoableChangeListener​(java.beans.VetoableChangeListener pcl)
        FOR INTERNAL USE ONLY
      • removeVetoableChangeListener

        public void removeVetoableChangeListener​(java.lang.String property,
                                                 java.beans.VetoableChangeListener pcl)
        FOR INTERNAL USE ONLY
      • indexOf

        public abstract int indexOf()
                             throws ReportException
        Returns the position of this object in the parent collection.
        Returns:
        Position of this object in the parent collection.
        Throws:
        ReportException - If there is no parent or the object does not exist.
        Since:
        7.0
      • setX

        public void setX​(int x)
        Sets the x position of the left upper corner of the element in the report. Use the 'object x position' property the adjust the element position from the left side margin. The unit is in twips.
        Parameters:
        x - The x position in twips.
        Throws:
        java.lang.IllegalArgumentException - if x is negative
        Since:
        7.0
      • getX

        public int getX()
        Returns the x position of the left upper corner of the element in the report. Use the 'object x position' property the adjust the element position from the left side margin. The unit is in twips.
        Returns:
        The x position in twips.
        Since:
        7.0
      • setY

        public void setY​(int y)
        Sets the y position of the left upper corner of the element in the report. Use the 'object y position' property the adjust the element position from the top margin. The unit is in twips.
        Parameters:
        y - position in twips.
        Throws:
        java.lang.IllegalArgumentException - if y is negative
        Since:
        7.0
      • getY

        public int getY()
        Returns the y position of the left upper corner of the element in the report. Use the 'object y position' property the adjust the element position from the top margin. The unit is in twips.
        Returns:
        The y position in twips.
        Since:
        7.0
      • setWidth

        public void setWidth​(int width)
        Sets the width of this report element. The unit is in twips.
        Parameters:
        width - The width in twips.
        Throws:
        java.lang.IllegalArgumentException - if width is negative
        Since:
        7.0
      • getWidth

        public int getWidth()
        Returns the width of this report element. Use the 'element width' property to change the width of the element. The unit is in twips.
        Returns:
        The width in twips.
        Throws:
        java.lang.UnsupportedOperationException - if this element spans multiple sections
        Since:
        7.0
      • setHeight

        public void setHeight​(int height)
        Sets the height of this report element. Use the 'element height' property to change the height of the element. The unit is in twips.
        Parameters:
        height - The height in twips.
        Throws:
        java.lang.IllegalArgumentException - if height is negative
        Since:
        7.0
      • getHeight

        public int getHeight()
        Returns the height of this report element. Use the 'element height' property to change the height of the element. The unit is in twips.
        Returns:
        The height in twips.
        Throws:
        java.lang.UnsupportedOperationException - if this element spans multiple sections
        Since:
        7.0
      • setSuppress

        public void setSuppress​(boolean newValue)
        Sets the value of the property 'suppress'. Set this property if you do not want the section to print, but you dont't want to keep the section content available for drill down. Drill Down is not supported yet.
        Parameters:
        newValue - The new value of the property 'suppress'.
        Since:
        7.0
      • isSuppress

        public boolean isSuppress()
        Returns the value of the property 'suppress'. Set this property if you do not want the section to print, but you dont't want to keep the section content available for drill down. Drill Down is not supported yet.
        Returns:
        The value of the property 'suppress'.
        Since:
        7.0
      • setSuppressFormula

        public void setSuppressFormula​(FormulaField newFormula)
        Sets the formula for the property 'suppress'. Use this property to change the visibility of the element when printing dynamically.
        Parameters:
        newFormula - The new formula for the property 'suppress'.
        Since:
        7.0
      • setBackColor

        public void setBackColor​(int backColor)
        Sets the background color of this report element. You can use the ABGR value (i.e. 0x000000FF for red) or one of the color constants in class CoderXML.
        Parameters:
        backColor - The new ABGR value of the background color.
        Since:
        7.0
        See Also:
        ColorUtils.toCcColor(Color), ColorUtils.toJavaColor(int)
      • getBackColor

        public int getBackColor()
        Returns the background color of this report element as ABGR, i.e. 0x000000FF for red.
        Returns:
        The background color as ABGR
        Since:
        7.0
        See Also:
        ColorUtils.toCcColor(Color), ColorUtils.toJavaColor(int)
      • setBackColorFormula

        public void setBackColorFormula​(FormulaField newFormula)
        Sets the background color of this report element. Set the value as ABGR, i.e. 0x000000FF for red or use the color constants in class CoderXML.
        Parameters:
        newFormula - Sets the new formula for 'back color'.
        Since:
        7.0
      • getBackColorFormula

        public FormulaField getBackColorFormula()
        Returns the background color formula of this report element. Set the value as ABGR, i.e. 0x000000FF for red or use the color constants in class CoderXML.
        Returns:
        FormulaField The formula of the property 'back color'.
        Since:
        7.0
        See Also:
        ColorUtils.toCcColor(Color), ColorUtils.toJavaColor(int)
      • isKeepTogether

        public boolean isKeepTogether()
        Returns the value of the property 'keep together'. If this property is enabled the element will not printed over more than one page. If no space is available on this page it will be printed on the next. Using this property for sections all elements will be printed on one page.
        Returns:
        The current value of the property 'keep together'.
        Since:
        7.0
      • setKeepTogether

        public void setKeepTogether​(boolean newValue)
        Sets the value of the property 'keep together'. If this property is enabled the element will not printed over more than one page. If no space is available on this page it will be printed on the next. Using this property for sections all elements will be printed on one page.
        Parameters:
        newValue - The new value of the property 'keep together'.
        Since:
        7.0
      • getKeepTogetherFormula

        public FormulaField getKeepTogetherFormula()
        Returns the formula for the property 'keep together'. If this property is enabled the element will not printed over more than one page. If no space is available on this page it will be printed on the next. Using this property for sections all elements will be printed on one page.
        Returns:
        FormulaField The formula for the property 'keep together'.
        Since:
        7.0
      • setKeepTogetherFormula

        public void setKeepTogetherFormula​(FormulaField newFormula)
        Sets the formula for the property 'keep together'. If this property is enabled the element will not printed over more than one page. If no space is available on this page it will be printed on the next. Using this property for sections all elements will be printed on one page.
        Parameters:
        newFormula - The new formula for the property 'keep together'.
        Since:
        7.0
      • addReferencedObject

        public final void addReferencedObject​(com.inet.report.ReferencedObject reference)
        FOR INTERNAL USE ONLY
        Specified by:
        addReferencedObject in interface com.inet.report.ReferenceHolder
      • getReferencedObjects

        public final com.inet.report.ReferencedObject[] getReferencedObjects()
        FOR INTERNAL USE ONLY
        Specified by:
        getReferencedObjects in interface com.inet.report.ReferenceHolder
      • getReferencedObjectCount

        public final int getReferencedObjectCount()
        FOR INTERNAL USE ONLY
        Specified by:
        getReferencedObjectCount in interface com.inet.report.ReferenceHolder
      • getRealReferencedObjectCount

        public final int getRealReferencedObjectCount()
        FOR INTERNAL USE ONLY
        Specified by:
        getRealReferencedObjectCount in interface com.inet.report.ReferenceHolder
      • removeReferencedObject

        public final void removeReferencedObject​(com.inet.report.ReferencedObject reference)
        FOR INTERNAL USE ONLY
        Specified by:
        removeReferencedObject in interface com.inet.report.ReferenceHolder
      • setReferences

        public void setReferences()
        FOR INTERNAL USE ONLY
        Specified by:
        setReferences in interface com.inet.report.ReferenceHolder
      • resetReferences

        public void resetReferences()
        FOR INTERNAL USE ONLY
        Specified by:
        resetReferences in interface com.inet.report.ReferenceHolder
      • getPropertyFormulas

        public java.util.List<FormulaField> getPropertyFormulas()
        Returns a list with all property formulas that are set for this report element. This includes property formulas for any type of sub-component but excludes formulas for any descendant ReportComponent of this one. To get the property formulas for descendant ReportComponent use getSubComponents()
        Returns:
        List of property formulas
        Since:
        7.0
      • getSubComponents

        public abstract java.util.List<? extends ReportComponent> getSubComponents()
        Returns all ReportComponents that are descendants of this one. E.G. this will return all Element of a Section. But it's as well useful for CrossTabs or Text elements which have additional elements.
        Returns:
        a list with all sub components which can be empty as well; will be null if the component has no descendants
        Since:
        14.0
      • paramString

        public java.lang.String paramString()
        Returns a string identifying this report component. This method is useful for logging and for debugging.
        Returns:
        a string identifying the ReportComponent
        Since:
        7.0
      • parseElement

        public NodeParser parseElement​(com.inet.report.parser.XMLTag group,
                                       java.lang.String tag,
                                       org.xml.sax.Attributes atts,
                                       java.util.Map<java.lang.String,​java.lang.Object> parserMap)
                                throws FatalParserException
        FOR INTERNAL USE ONLY Internal method for reading report XML

        Parses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.

        Specified by:
        parseElement in interface NodeParser
        Parameters:
        group - XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.
        tag - The XMLTag to be parsed
        atts - The set of attributes in the current XMLTag
        parserMap - The map of current Parser.
        Returns:
        The NodeParser sub-element if one needed to be created, or null if none was created.
        Throws:
        FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
      • parseText

        public void parseText​(java.lang.String text,
                              java.util.Map<java.lang.String,​java.lang.Object> parserMap)
        FOR INTERNAL USE ONLY Internal method for reading report XML

        This method is called if text was encountered in the context of this node. (Examples would be a formula's text or a text element's text)

        Specified by:
        parseText in interface NodeParser
        Parameters:
        text - text encountered and to be stored
        parserMap - The map of current Parser.
      • parseEndElement

        public void parseEndElement​(com.inet.report.parser.XMLTag group,
                                    java.lang.String tag,
                                    java.util.Map<java.lang.String,​java.lang.Object> parserMap)
                             throws FatalParserException
        FOR INTERNAL USE ONLY Internal method for reading report XML

        Receive notification of the end of an XML tag.

        Specified by:
        parseEndElement in interface NodeParser
        Parameters:
        group - XMLTag of the current node to be parsed, or null if there is no such current group.
        tag - The XMLTag to be parsed
        parserMap - The map of current Parser.
        Throws:
        FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
      • isDOMParser

        public boolean isDOMParser()
        FOR INTERNAL USE ONLY Internal method for reading report XML

        Returns whether this node is to be read via a DOM parser.

        Specified by:
        isDOMParser in interface NodeParser
        Returns:
        true if this node is to be read via a DOM parser, false otherwise.
      • parseDOM

        public void parseDOM​(org.w3c.dom.Node node,
                             java.util.Map<java.lang.String,​java.lang.Object> parserMap)
                      throws FatalParserException
        FOR INTERNAL USE ONLY Internal method for reading report XML

        Parses the node.

        Specified by:
        parseDOM in interface NodeParser
        Parameters:
        node - the node
        parserMap - The map of current Parser.
        Throws:
        FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
      • getCustomData

        public java.lang.Object getCustomData()
        FOR INTERNAL USE ONLY Returns the custom data of this report component.
        Returns:
        custom data of report component.
        Since:
        9.2
      • setCustomData

        public void setCustomData​(java.lang.Object customData)
        FOR INTERNAL USE ONLY Sets the custom data for this report component.
        Parameters:
        customData - custom data of report component.
        Since:
        9.2