Style Intelligence v12.0

inetsoft.report.filter
Class AbstractGroupedTable

java.lang.Object
  extended by inetsoft.report.lens.AbstractTableLens
      extended by inetsoft.report.filter.AbstractGroupedTable
All Implemented Interfaces:
GroupedTable, RegionTable, StyleConstants, TableFilter, TableLens, XConstants, XTable, Serializable, Cloneable
Direct Known Subclasses:
GroupedColumnMapFilter, GroupedSortFilter, GroupFilter, SummaryFilter, TopNFilter, TransparentGroupFilter

public abstract class AbstractGroupedTable
extends AbstractTableLens
implements TableFilter, GroupedTable

An abstract grouped table contains common methods of grouped table.

See Also:
Serialized Form

Nested Class Summary
protected  class AbstractGroupedTable.BooleanObject
          A class wrap a boolean object.
 
Field Summary
 
Fields inherited from class inetsoft.report.lens.AbstractTableLens
descriptor, isLeftAlign
 
Fields inherited from interface inetsoft.report.filter.GroupedTable
GROUP_HEADER_FULL, GROUP_HEADER_IN_PLACE, GROUP_HEADER_ROWS
 
Fields inherited from interface inetsoft.report.TableLens
BREAK_BORDER, NULL
 
Fields inherited from interface inetsoft.uql.XTable
EOT
 
Fields inherited from interface inetsoft.report.StyleConstants
ARROW_LINE_1, ARROW_LINE_2, ARROW_LINE_3, BACKGROUND_CENTER, BACKGROUND_TILED, BOX_RECTANGLE, BOX_ROUNDED_RECTANGLE, CENTER, CHART_3D_BAR, CHART_3D_BAR_3D, CHART_3D_PIE, CHART_3D_STACK_BAR, CHART_AREA, CHART_BAR, CHART_BUBBLE, CHART_CANDLE, CHART_CURVE, CHART_FILL_RADAR, CHART_GANTT, CHART_INV_BAR, CHART_INV_CURVE, CHART_INV_LINE, CHART_INV_POINT, CHART_INV_STACK_BAR, CHART_LINE, CHART_MAX_USER, CHART_PARETO, CHART_PIE, CHART_PIE_EXPLODED_ALL, CHART_PIE_EXPLODED_FIRST, CHART_PIE_EXPLODED_NONE, CHART_POINT, CHART_RADAR, CHART_RIBBON, CHART_SCATTER, CHART_SPEEDOMETER, CHART_STACK_AREA, CHART_STACK_BAR, CHART_STICK, CHART_STOCK, CHART_SURFACE, CHART_USER, CHART_VOLUME, CHART_WATERFALL, CHART_XY_LINE, CIRCLE, CROSS, CURRENCY, DASH_LINE, DASH_MASK, DEFAULT_PAGE_SIZE, DIAMOND, DOT_LINE, DOUBLE_3D_LOWERED, DOUBLE_3D_RAISED, DOUBLE_LINE, DOUBLE_MASK, FILL, FILLED_CIRCLE, FILLED_DIAMOND, FILLED_SQUARE, FILLED_TRIANGLE, FRACTION_WIDTH_MASK, H_ALIGN_MASK, H_CENTER, H_CURRENCY, H_LEFT, H_LINE, H_RIGHT, LANDSCAPE, LARGE_DASH, LEFT, LINECAP_BUTT, LINECAP_ROUND, LINECAP_SQUARE, LINEJOIN_BEVEL, LINEJOIN_MITER, LINEJOIN_ROUND, LOWERED_3D, LOWERED_MASK, LT_ANGLE, MEDIUM_DASH, MEDIUM_LINE, NIL, NO_BORDER, NONE, PAPER_10X11, PAPER_10X14, PAPER_11X17, PAPER_15X11, PAPER_9X11, PAPER_A_PLUS, PAPER_A2, PAPER_A3, PAPER_A3_EXTRA, PAPER_A3_EXTRA_TRANSVERSE, PAPER_A3_TRANSVERSE, PAPER_A4, PAPER_A4_EXTRA, PAPER_A4_PLUS, PAPER_A4_TRANSVERSE, PAPER_A4SMALL, PAPER_A5, PAPER_A5_EXTRA, PAPER_A5_TRANSVERSE, PAPER_B_PLUS, PAPER_B4, PAPER_B5, PAPER_B5_EXTRA, PAPER_B5_TRANSVERSE, PAPER_CSHEET, PAPER_DSHEET, PAPER_ENV_10, PAPER_ENV_11, PAPER_ENV_12, PAPER_ENV_14, PAPER_ENV_9, PAPER_ENV_B4, PAPER_ENV_B5, PAPER_ENV_B6, PAPER_ENV_C3, PAPER_ENV_C4, PAPER_ENV_C5, PAPER_ENV_C6, PAPER_ENV_C65, PAPER_ENV_DL, PAPER_ENV_INVITE, PAPER_ENV_ITALY, PAPER_ENV_MONARCH, PAPER_ENV_PERSONAL, PAPER_ESHEET, PAPER_EXECUTIVE, PAPER_FANFOLD_LGL_GERMAN, PAPER_FANFOLD_STD_GERMAN, PAPER_FANFOLD_US, PAPER_FOLIO, PAPER_ISO_B4, PAPER_JAPANESE_POSTCARD, PAPER_LEDGER, PAPER_LEGAL, PAPER_LEGAL_EXTRA, PAPER_LETTER, PAPER_LETTER_EXTRA, PAPER_LETTER_EXTRA_TRANSVERSE, PAPER_LETTER_PLUS, PAPER_LETTER_TRANSVERSE, PAPER_LETTERSMALL, PAPER_NOTE, PAPER_QUARTO, PAPER_STATEMENT, PAPER_TABLOID, PAPER_TABLOID_EXTRA, PATTERN_0, PATTERN_1, PATTERN_10, PATTERN_11, PATTERN_12, PATTERN_13, PATTERN_14, PATTERN_15, PATTERN_16, PATTERN_17, PATTERN_18, PATTERN_19, PATTERN_2, PATTERN_3, PATTERN_4, PATTERN_5, PATTERN_6, PATTERN_7, PATTERN_8, PATTERN_9, PATTERN_NONE, PORTRAIT, RAISED_3D, RAISED_MASK, REMAINDER, RIGHT, RIGHT_ANGLE, SOLID_MASK, SQUARE, STAR, THICK_LINE, THIN_LINE, THIN_THIN_LINE, TRAY_AUTO, TRAY_CASSETTE, TRAY_ENVELOPE, TRAY_ENVMANUAL, TRAY_FORMSOURCE, TRAY_LARGECAPACITY, TRAY_LARGEFMT, TRAY_LOWER, TRAY_MANUAL, TRAY_MIDDLE, TRAY_ONLYONE, TRAY_SMALLFMT, TRAY_TRACTOR, TRAY_UPPER, TRIANGLE, ULTRA_THIN_LINE, V_ALIGN_MASK, V_ANGLE, V_BASELINE, V_BOTTOM, V_CENTER, V_LINE, V_TOP, WIDTH_MASK, X
 
Fields inherited from interface inetsoft.uql.XConstants
AM_PM_DATE_GROUP, AM_PM_OF_DAY_DATE_GROUP, AVERAGE_FORMULA, CALC_FORMULA, COLUMN, CONCAT_FORMULA, CONDITION_EMPTY_STRING, CONDITION_NULL_STRING, CONDITION_NULL_VALUE, CONDITION_REAL_NULL, CORRELATION_FORMULA, COUNT_FORMULA, COVARIANCE_FORMULA, CURRENCY_FORMAT, CURRENT_REP_CHANGED, CURRENT_REP_WILL_CHANGE, DATE_FORMAT, DAY_DATE_GROUP, DAY_OF_MONTH_DATE_GROUP, DAY_OF_WEEK_DATE_GROUP, DAY_OF_YEAR_DATE_GROUP, DECIMAL_FORMAT, DISTINCTCOUNT_FORMULA, FIRST_FORMULA, FULL_JOIN, GREATER_EQUAL_JOIN, GREATER_JOIN, GROUP_OTHERS, HOUR_DATE_GROUP, HOUR_OF_DAY_DATE_GROUP, INNER_JOIN, JOIN, LAST_FORMULA, LEAVE_OTHERS, LEFT_JOIN, LESS_EQUAL_JOIN, LESS_JOIN, MAX_FORMULA, MEDIAN_FORMULA, MESSAGE_FORMAT, MILLISECOND_DATE_GROUP, MIN_FORMULA, MINUTE_DATE_GROUP, MODE_FORMULA, MONTH_DATE_GROUP, MONTH_OF_YEAR_DATE_GROUP, NONE_DATE_GROUP, NONE_FORMULA, NOT_EQUAL_JOIN, NTHLARGEST_FORMULA, NTHMOSTFREQUENT_FORMULA, NTHSMALLEST_FORMULA, PARAM_PREFIX, PART_DATE_GROUP, PERCENT_FORMAT, PERCENTAGE_BY_COL, PERCENTAGE_BY_ROW, PERCENTAGE_NONE, PERCENTAGE_OF_COL_GRANDTOTAL, PERCENTAGE_OF_COL_GROUP, PERCENTAGE_OF_GRANDTOTAL, PERCENTAGE_OF_GROUP, PERCENTAGE_OF_ROW_GRANDTOTAL, PERCENTAGE_OF_ROW_GROUP, POPULATIONSTANDARDDEVIATION_FORMULA, POPULATIONVARIANCE_FORMULA, PRODUCT_FORMULA, PTHPERCENTILE_FORMULA, QUARTER_DATE_GROUP, QUARTER_OF_YEAR_DATE_GROUP, RIGHT_JOIN, SECOND_DATE_GROUP, SET_FORMULA, SORT_ASC, SORT_DESC, SORT_NONE, SORT_ORIGINAL, SORT_SPECIFIC, SORT_VALUE_ASC, SORT_VALUE_DESC, STANDARDDEVIATION_FORMULA, SUB_QUERY_PARAM, SUM_FORMULA, SUMSQ_FORMULA, SUMWT_FORMULA, VARIANCE_FORMULA, WEEK_DATE_GROUP, WEEK_OF_MONTH_DATE_GROUP, WEEK_OF_YEAR_DATE_GROUP, WEIGHTEDAVERAGE_FORMULA, YEAR_DATE_GROUP
 
Constructor Summary
AbstractGroupedTable()
           
 
Method Summary
 void clearCache()
          Clear the cached data.
 void clearPageBreaks()
          Clear page breaks.
 int firstSummaryColumn()
          Return the first summary column number.
 int[] getAvailableLevels(int row)
          Get available group levels of a row when get group first/last row.
abstract  int getBaseRowIndex(int row)
          Get the base table row index corresponding to the grouped table.
 String getColumnIdentifier(int col)
          Get the column identifier of a column.
abstract  Formula getGrandFormula(int col)
          Get the grand total formula of the column.
abstract  int getGroupColCount()
          Return the number of grouping columns.
 int getGroupColLevel(int col)
          Get a group col's group lvl.
abstract  int getGroupColumns(int level)
          Get the number of columns used in the specified grouping level.
 int getGroupFirstRow(int row)
          Get the first row at the specified row.
 int getGroupFirstRow(int row, int level)
          Get the first row at specified row and group level.
protected  int getGroupFirstRow0(int row, int lvl)
          Internal method to get the first row at the specified row and group lvl.
abstract  Formula getGroupFormula(int col)
          Get the group formula of the column.
abstract  int getGroupHeaderStyle()
          Get the group header style.
 int getGroupLastRow(int row)
          Get the last row at the specified row.
 int getGroupLastRow(int row, int level)
          Get the last row at specified row and group level.
protected  int getGroupLastRow0(int row, int lvl)
          Internal method to get the last row at the specified row and group lvl.
abstract  int getGroupLevel(int r)
          Get the grouping level of this group header.
 int getGroupLevel0(int r)
          Get the internal keep row lvl for the first row of a group.
protected  String getHeader2(String header, boolean special)
          Get a special header string from the given header.
 boolean[] getMergedGroup()
          Check the merge group cell option for all group column.
protected  TableDataPath getOriginalPath(TableDataPath path, AbstractGroupedTable.BooleanObject aggregated, boolean special)
          Get the origial data path from the specified path.
 BitSet getPageBreakLevels()
          Get page break levels.
 int getRealGroupColCount()
          Get real group column count of a grouped table.
 Dimension getSpan(int r, int c)
          Return the spanning setting for the cell.
abstract  int getSummaryLevel(int r)
          Get the grouping level of a summary row.
abstract  boolean hasGrandSummary()
          Check if this table contains grand summary row.
abstract  boolean isAddGroupHeader()
          Check if group header is to be added to the grouped data.
abstract  boolean isGroupHeaderCell(int r, int c)
          Check if a cell is a group header cell.
abstract  boolean isGroupHeaderRow(int r)
          Check if a row is displaying group header.
 boolean isMergedGroup(int index)
          Check the merge group cell for given index group column.
 boolean isMergeGroupCells()
          Check the merge group cell option.
abstract  boolean isShowGroupColumns()
          Check if the group column contents are shown.
abstract  boolean isSummaryCol(int col)
          Check if a column is a summary column.
abstract  boolean isSummaryRow(int row)
          Check if a row is a summary row.
abstract  void setAddGroupHeader(boolean h)
          Set whether group headers are added to the table.
abstract  void setGroupHeaderStyle(int headerS)
          Set the group header style.
 void setMergedGroup(boolean[] merge)
          Set merging group cell option for all group column.
 void setMergeGroupCells(boolean merge)
          Set merging group cell option.
abstract  void setShowGroupColumns(boolean grp)
          Set the show group column contents option.
 
Methods inherited from class inetsoft.report.lens.AbstractTableLens
addChangeListener, clone, containsDrill, containsFormat, dispose, findColumnByIdentifier, fireChangeEvent, getAlignment, getBackground, getBoolean, getByte, getColBorder, getColBorderColor, getColType, getColWidth, getDefaultFormat, getDescriptor, getDouble, getFloat, getFont, getForeground, getHeaderColCount, getHeaderRowCount, getInsets, getInt, getLong, getRowBorder, getRowBorderColor, getRowHeight, getShort, getTrailerColCount, getTrailerRowCount, getXDrillInfo, isLineWrap, isNull, isPrimitive, moreRows, removeChangeListener, setColumnIdentifier, setLeftAlign, setLocal, setObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface inetsoft.report.TableFilter
getBaseColIndex, getTable, invalidate, setTable
 
Methods inherited from interface inetsoft.report.TableLens
addChangeListener, containsDrill, containsFormat, getAlignment, getBackground, getColBorder, getColBorderColor, getColWidth, getDefaultFormat, getDescriptor, getFont, getForeground, getInsets, getRowBorder, getRowBorderColor, getRowHeight, getXDrillInfo, isLineWrap, removeChangeListener
 
Methods inherited from interface inetsoft.uql.XTable
dispose, getBoolean, getByte, getColCount, getColType, getDouble, getFloat, getHeaderColCount, getHeaderRowCount, getInt, getLong, getObject, getRowCount, getShort, getTrailerColCount, getTrailerRowCount, isNull, isPrimitive, moreRows, setColumnIdentifier, setObject
 

Constructor Detail

AbstractGroupedTable

public AbstractGroupedTable()
Method Detail

getGroupColCount

public abstract int getGroupColCount()
Return the number of grouping columns. Multiple column group is counted as one group column.

Specified by:
getGroupColCount in interface GroupedTable

isGroupHeaderRow

public abstract boolean isGroupHeaderRow(int r)
Check if a row is displaying group header.

Specified by:
isGroupHeaderRow in interface GroupedTable
Parameters:
r - row number.

isGroupHeaderCell

public abstract boolean isGroupHeaderCell(int r,
                                          int c)
Check if a cell is a group header cell. This is more accurate than the isGroupHeaderRow() because it takes into consideration of the in-place header rows (where it's partially a header and body).

Specified by:
isGroupHeaderCell in interface GroupedTable
Specified by:
isGroupHeaderCell in interface RegionTable
Parameters:
r - row number.
c - column number.
Returns:
true if the cell is a group header cell.

getGroupColumns

public abstract int getGroupColumns(int level)
Get the number of columns used in the specified grouping level. This is normally 1 unless multiple columns are combined into one group.

Specified by:
getGroupColumns in interface GroupedTable

getGroupLevel

public abstract int getGroupLevel(int r)
Get the grouping level of this group header. The row number must refer to a header row.

Specified by:
getGroupLevel in interface GroupedTable
Specified by:
getGroupLevel in interface RegionTable
Returns:
grouping level. The top-most group is level 0. Returns -1 if the row is not a header row.

isShowGroupColumns

public abstract boolean isShowGroupColumns()
Check if the group column contents are shown. This is true by default. If it's false, the group columns are hidden.

Specified by:
isShowGroupColumns in interface GroupedTable
Returns:
true if group columns are shown.

setShowGroupColumns

public abstract void setShowGroupColumns(boolean grp)
Set the show group column contents option. If it's turned off, the grouped columns will have empty contents. If the ShowGroupColumns is set to false, the AddGroupHeader is automatically turned on.

Specified by:
setShowGroupColumns in interface GroupedTable
Parameters:
grp - show group column contents.

isAddGroupHeader

public abstract boolean isAddGroupHeader()
Check if group header is to be added to the grouped data.

Specified by:
isAddGroupHeader in interface GroupedTable
Returns:
true if group header is added. Default to false.

setAddGroupHeader

public abstract void setAddGroupHeader(boolean h)
Set whether group headers are added to the table. Group headers are separate rows containing only the group column value for the section.

Specified by:
setAddGroupHeader in interface GroupedTable

getGroupHeaderStyle

public abstract int getGroupHeaderStyle()
Get the group header style.

Specified by:
getGroupHeaderStyle in interface GroupedTable
Returns:
group header style.

setGroupHeaderStyle

public abstract void setGroupHeaderStyle(int headerS)
Set the group header style. This must be called before the refresh() is called.

Specified by:
setGroupHeaderStyle in interface GroupedTable
Parameters:
headerS - one of GROUP_HEADER_IN_PLACE, GROUP_HEADER_ROWS (default).

isSummaryRow

public abstract boolean isSummaryRow(int row)
Check if a row is a summary row.

Specified by:
isSummaryRow in interface GroupedTable
Specified by:
isSummaryRow in interface RegionTable
Parameters:
row - the row number.
Returns:
true if the row is a summary row.

isSummaryCol

public abstract boolean isSummaryCol(int col)
Check if a column is a summary column.

Specified by:
isSummaryCol in interface GroupedTable
Parameters:
col - the column number.
Returns:
true if the column is a summary column.

getSummaryLevel

public abstract int getSummaryLevel(int r)
Get the grouping level of a summary row. The row number must refer to a summary row.

Specified by:
getSummaryLevel in interface GroupedTable
Specified by:
getSummaryLevel in interface RegionTable
Returns:
grouping level. The top-most group is level 0. Returns -1 if the row is not a summary row.

hasGrandSummary

public abstract boolean hasGrandSummary()
Check if this table contains grand summary row.

Specified by:
hasGrandSummary in interface GroupedTable
Returns:
true if grand summary row exists.

getBaseRowIndex

public abstract int getBaseRowIndex(int row)
Get the base table row index corresponding to the grouped table. If the row does not exist in the base table, it returns -1.

Specified by:
getBaseRowIndex in interface GroupedTable
Specified by:
getBaseRowIndex in interface TableFilter
Parameters:
row - row index in the grouped table.
Returns:
corresponding row index in the base table.

getGroupFormula

public abstract Formula getGroupFormula(int col)
Get the group formula of the column.

Specified by:
getGroupFormula in interface GroupedTable
Parameters:
col - column index in the grouped table.
Returns:
the group formula of column

getGrandFormula

public abstract Formula getGrandFormula(int col)
Get the grand total formula of the column.

Specified by:
getGrandFormula in interface GroupedTable
Parameters:
col - column index in the grouped table.
Returns:
the grand total formula of column

setMergeGroupCells

public void setMergeGroupCells(boolean merge)
Set merging group cell option. If set, group cells of the same group are merged into one span cell.

Specified by:
setMergeGroupCells in interface GroupedTable

isMergeGroupCells

public boolean isMergeGroupCells()
Check the merge group cell option.

Specified by:
isMergeGroupCells in interface GroupedTable

setMergedGroup

public void setMergedGroup(boolean[] merge)
Set merging group cell option for all group column. If set, group cells of the same group are merged into one span cell.


getMergedGroup

public boolean[] getMergedGroup()
Check the merge group cell option for all group column.


getRealGroupColCount

public int getRealGroupColCount()
Get real group column count of a grouped table.

Returns:
real group column count of the grouped table

getGroupFirstRow

public int getGroupFirstRow(int row,
                            int level)
Get the first row at specified row and group level.

Specified by:
getGroupFirstRow in interface GroupedTable
Parameters:
row - the specified row
level - the specified group level
Returns:
the first row, -1 if not available

getGroupLastRow

public int getGroupLastRow(int row,
                           int level)
Get the last row at specified row and group level.

Specified by:
getGroupLastRow in interface GroupedTable
Parameters:
row - the specified row
level - the specified group level
Returns:
the last row, -1 if not available

getGroupFirstRow

public int getGroupFirstRow(int row)
Get the first row at the specified row. The default group level is the highest available group level at the specified row.

Specified by:
getGroupFirstRow in interface GroupedTable
Parameters:
row - the specified row
Returns:
the first row, -1 if not available

getGroupLastRow

public int getGroupLastRow(int row)
Get the last row at the specified row. The default group level is the highest available group level at the specified row.

Specified by:
getGroupLastRow in interface GroupedTable
Parameters:
row - the specified row
Returns:
the last row, -1 if not available

getAvailableLevels

public int[] getAvailableLevels(int row)
Get available group levels of a row when get group first/last row.

Specified by:
getAvailableLevels in interface GroupedTable
Parameters:
row - the specified row
Returns:
the available group level array

clearPageBreaks

public void clearPageBreaks()
Clear page breaks.


getPageBreakLevels

public BitSet getPageBreakLevels()
Get page break levels.

Returns:
page break levels.

getColumnIdentifier

public String getColumnIdentifier(int col)
Get the column identifier of a column.

Specified by:
getColumnIdentifier in interface XTable
Overrides:
getColumnIdentifier in class AbstractTableLens
Parameters:
col - the specified column index.
Returns:
the column indentifier of the column. The identifier might be different from the column name, for it may contain more locating information than the column name.

getSpan

public Dimension getSpan(int r,
                         int c)
Return the spanning setting for the cell. If the specified cell is not a spanning cell, it returns null. Otherwise it returns a Dimension object with Dimension.width equals to the number of columns and Dimension.height equals to the number of rows of the spanning cell.

Specified by:
getSpan in interface TableLens
Overrides:
getSpan in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
span cell dimension.

getGroupFirstRow0

protected int getGroupFirstRow0(int row,
                                int lvl)
Internal method to get the first row at the specified row and group lvl.

Parameters:
row - the specified row
lvl - the specified group lvl
Returns:
the first row, -1 if the group first row is not found.

getGroupLastRow0

protected int getGroupLastRow0(int row,
                               int lvl)
Internal method to get the last row at the specified row and group lvl.

Parameters:
row - the specified row
lvl - the specified group lvl
Returns:
the last row, -1 if the group last row is not found.

getGroupColLevel

public int getGroupColLevel(int col)
Get a group col's group lvl.

Specified by:
getGroupColLevel in interface GroupedTable
Parameters:
col - the group col
Returns:
the group col's group lvl, -1 means not a group col

clearCache

public void clearCache()
Clear the cached data.


getGroupLevel0

public int getGroupLevel0(int r)
Get the internal keep row lvl for the first row of a group.


firstSummaryColumn

public int firstSummaryColumn()
Return the first summary column number.


getOriginalPath

protected TableDataPath getOriginalPath(TableDataPath path,
                                        AbstractGroupedTable.BooleanObject aggregated,
                                        boolean special)
Get the origial data path from the specified path.

Parameters:
path - the path used to get original data path.
aggregated - a indicator to check the path is a summary column.
special - identical to get the original path by special case, such as remove the DateRangeRef's special prefix.
Returns:
the original path.

getHeader2

protected String getHeader2(String header,
                            boolean special)
Get a special header string from the given header.

Parameters:
header - the given header to get another header string.
special - to special case of the header.
Returns:
another header string.

isMergedGroup

public boolean isMergedGroup(int index)
Check the merge group cell for given index group column.


Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.