Class CrossTabHeaderList

  • All Implemented Interfaces:
    java.io.Serializable

    public class CrossTabHeaderList
    extends java.lang.Object
    implements java.io.Serializable
    This is a container for CrossTabHeader. A crosstab has 2 of this containers. One for rows and one for columns.
    Since:
    12.0
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CrossTabHeader add​(Field field)
      Create a new header with the given field.
      CrossTabHeader get​(int index)
      Returns the CrossTabHeader at the specified position in this list.
      CrossTabHeader getGrandTotal()
      The header with the grand total label.
      boolean getIndentLabel()
      Returns whether the row label should be indent (true) or not (false).
      int getIndentLabelSize()
      Returns the size of indentation of the row label in twips.
      boolean getSuppressEmptyLines()
      Returns whether empty rows/columns should be suppressed (true) or not (false).
      FormulaField getSuppressEmptyLinesFormula()
      Returns the formula for the property 'suppress empty columns'.
      boolean getTotalOnStart()
      Returns whether Column Total should be on left or top (true) or not (false).
      FormulaField getTotalOnStartFormula()
      Returns the formula for showing the total on start or on end.
      boolean isRow()
      The type of the headers.
      void move​(int from, int to)
      Move the position of a header
      void remove​(int index)
      Removes the i-th column or row of the crosstab.
      void setIndentLabel​(boolean indentLabel)
      Sets whether the row label should be indent (true) or not (false).
      void setIndentLabelSize​(int indentLabelSize)
      Sets the size of indentation of the row label for the crosstab's indent row label mode.
      void setSuppressEmptyLines​(boolean suppressEmptyLines)
      Sets whether empty rows/columns should be suppressed (true) or not (false).
      void setSuppressEmptyLinesFormula​(FormulaField newFormula)
      Sets the formula for the property 'suppress empty rows'.
      void setTotalOnStart​(boolean value)
      Sets whether Column Total should be drawn on left or top side (true) or not (false).
      void setTotalOnStartFormula​(FormulaField newFormula)
      Sets the formula for showing the total on start or on end.
      int size()
      Returns the number of headers.
      • Methods inherited from class java.lang.Object

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

      • remove

        public void remove​(int index)
                    throws ReportException
        Removes the i-th column or row of the crosstab. The index i must be greater than 0 and less than getHeaderCount().
        Parameters:
        index - Index of the column or row.
        Throws:
        java.lang.IllegalArgumentException - if index is negative.
        ReportException - if index is 0 (grand total).
        Since:
        12.0
      • add

        @Nonnull
        public CrossTabHeader add​(@Nonnull
                                  Field field)
        Create a new header with the given field.
        Parameters:
        field - the field which should be group.
        Returns:
        the new CrossTabHeader
        Since:
        12.0
      • move

        public void move​(int from,
                         int to)
                  throws ReportException
        Move the position of a header
        Parameters:
        from - original position in the range from 1 to size() -1
        to - new position in the range from 1 to size() -1
        Throws:
        ReportException - if you want move the grand total (index 0)
        Since:
        12.1
      • get

        @Nonnull
        public CrossTabHeader get​(int index)
        Returns the CrossTabHeader at the specified position in this list.
        Parameters:
        index - index of the CrossTabHeader to return
        Returns:
        the CrossTabHeader at the specified position in this list
        Since:
        12.0
      • isRow

        public boolean isRow()
        The type of the headers.
        Returns:
        true, if this are row header, false, if this are column headers.
        Since:
        12.0
      • size

        public int size()
        Returns the number of headers. A valid crosstab contains at least one row/column header (grand total).
        Returns:
        The number of headers.
        Since:
        12.0
      • getGrandTotal

        @Nonnull
        public CrossTabHeader getGrandTotal()
        The header with the grand total label. The header has not a field for grouping. This is equivalent to get(0).
        Returns:
        the grand total header
        Since:
        12.0
      • getTotalOnStart

        public boolean getTotalOnStart()
        Returns whether Column Total should be on left or top (true) or not (false).
        Returns:
        True if total should be drawn on the left or top side.
        Since:
        12.0
      • setTotalOnStart

        public void setTotalOnStart​(boolean value)
        Sets whether Column Total should be drawn on left or top side (true) or not (false).
        Parameters:
        value - The value of the property
        Since:
        12.0
      • setTotalOnStartFormula

        public void setTotalOnStartFormula​(FormulaField newFormula)
        Sets the formula for showing the total on start or on end. If this property is enabled total column of the crosstab will be printed at the left or top side of the crosstab.
        Parameters:
        newFormula - The new formula for the property.
        Since:
        12.0
      • getTotalOnStartFormula

        public FormulaField getTotalOnStartFormula()
        Returns the formula for showing the total on start or on end. If this property is enabled total column of the crosstab will be printed on the left or top side of the crosstab.
        Returns:
        FormulaField The formula for the property 'suppress empty columns'.
        Since:
        12.0
      • getSuppressEmptyLines

        public boolean getSuppressEmptyLines()
        Returns whether empty rows/columns should be suppressed (true) or not (false).
        Returns:
        True if empty columns should be suppressed, else false
        Since:
        12.0
      • setSuppressEmptyLines

        public void setSuppressEmptyLines​(boolean suppressEmptyLines)
        Sets whether empty rows/columns should be suppressed (true) or not (false).
        Parameters:
        suppressEmptyLines - The flag to set
        Since:
        12.0
      • setSuppressEmptyLinesFormula

        public void setSuppressEmptyLinesFormula​(FormulaField newFormula)
        Sets the formula for the property 'suppress empty rows'. If this property is enabled empty rows of the crosstab will not be printed.
        Parameters:
        newFormula - The new formula for the property 'suppress empty rows'.
        Since:
        12.0
      • getSuppressEmptyLinesFormula

        public FormulaField getSuppressEmptyLinesFormula()
        Returns the formula for the property 'suppress empty columns'. If this property is enabled empty columns of the crosstab will not be printed.
        Returns:
        FormulaField The formula for the property 'suppress empty columns'.
        Since:
        12.0
      • getIndentLabel

        public boolean getIndentLabel()
        Returns whether the row label should be indent (true) or not (false).
        Returns:
        True if the crosstab will be drawn in indent rows label mode, else false.
        Since:
        12.0
      • setIndentLabel

        public void setIndentLabel​(boolean indentLabel)
        Sets whether the row label should be indent (true) or not (false).
        Parameters:
        indentLabel - The indentRowLabel to set
        Since:
        12.0
      • getIndentLabelSize

        public int getIndentLabelSize()
        Returns the size of indentation of the row label in twips.
        Returns:
        The size of indentation of the row label.
        Since:
        12.0
      • setIndentLabelSize

        public void setIndentLabelSize​(int indentLabelSize)
        Sets the size of indentation of the row label for the crosstab's indent row label mode.
        Parameters:
        indentLabelSize - The indentRowLabelSize to set in twips.
        Throws:
        java.lang.IllegalArgumentException - if indentRowLabelSize is negative
        Since:
        12.0