Class BandedMDXTableModel

  • All Implemented Interfaces:
    Serializable, TableModel, org.pentaho.reporting.engine.classic.core.MetaTableModel, org.pentaho.reporting.engine.classic.core.util.CloseableTableModel

    public class BandedMDXTableModel
    extends AbstractTableModel
    implements org.pentaho.reporting.engine.classic.core.util.CloseableTableModel, org.pentaho.reporting.engine.classic.core.MetaTableModel
    This tablemodel performs some preprocessing to get multi-dimensional resultset (with row and column headers) into a classical table-structure. The query must be a two-dimensional query or the whole process will break.

    This class exists for legacy reasons to provide existing reports the same view on MDX data as implemented in the Pentaho-Platform and the Report-Designer. It can also be somewhat useful if you have a requirement to produce banded reporting over a MDX data source.

    Author:
    : Thomas Morgner
    See Also:
    Serialized Form
    • Constructor Detail

      • BandedMDXTableModel

        @Deprecated
        public BandedMDXTableModel​(mondrian.olap.Result resultSet,
                                   int rowLimit)
        Deprecated.
      • BandedMDXTableModel

        public BandedMDXTableModel​(mondrian.olap.Result resultSet,
                                   int rowLimit,
                                   boolean membersOnAxisSorted)
    • Method Detail

      • computeColumnCount

        protected int computeColumnCount​(int[] axesMembers,
                                         int[] axesSize)
      • computeRowCount

        protected int computeRowCount​(int[] axesSize)
      • computeColumnNames

        protected List<String> computeColumnNames​(mondrian.olap.Axis[] axes,
                                                  List<mondrian.olap.Member> columnToMemberMapper)
      • getColumnName

        public String getColumnName​(int column)
        Returns a default name for the column using spreadsheet conventions: A, B, C, ... Z, AA, AB, etc. If column cannot be found, returns an empty string.
        Specified by:
        getColumnName in interface TableModel
        Overrides:
        getColumnName in class AbstractTableModel
        Parameters:
        column - the column being queried
        Returns:
        a string containing the default name of column
      • close

        public void close()
        Specified by:
        close in interface org.pentaho.reporting.engine.classic.core.util.CloseableTableModel
      • getCellDataAttributes

        public org.pentaho.reporting.engine.classic.core.wizard.DataAttributes getCellDataAttributes​(int rowIndex,
                                                                                                     int columnIndex)
        Returns the meta-attribute as Java-Object. The object type that is expected by the report engine is defined in the TableMetaData property set. It is the responsibility of the implementor to map the native meta-data model into a model suitable for reporting.

        Meta-data models that only describe meta-data for columns can ignore the row-parameter.

        Specified by:
        getCellDataAttributes in interface org.pentaho.reporting.engine.classic.core.MetaTableModel
        Parameters:
        rowIndex - the row of the cell for which the meta-data is queried.
        columnIndex - the index of the column for which the meta-data is queried.
        Returns:
        the meta-data object.
      • isCellDataAttributesSupported

        public boolean isCellDataAttributesSupported()
        Specified by:
        isCellDataAttributesSupported in interface org.pentaho.reporting.engine.classic.core.MetaTableModel
      • getColumnAttributes

        public org.pentaho.reporting.engine.classic.core.wizard.DataAttributes getColumnAttributes​(int column)
        Specified by:
        getColumnAttributes in interface org.pentaho.reporting.engine.classic.core.MetaTableModel
      • getTableAttributes

        public org.pentaho.reporting.engine.classic.core.wizard.DataAttributes getTableAttributes()
        Returns table-wide attributes. This usually contain hints about the data-source used to query the data as well as hints on the sort-order of the data.
        Specified by:
        getTableAttributes in interface org.pentaho.reporting.engine.classic.core.MetaTableModel
        Returns:
        the table attributes.