Style Intelligence v12.0

inetsoft.report.filter
Class GroupFilter

java.lang.Object
  extended by inetsoft.report.lens.AbstractTableLens
      extended by inetsoft.report.filter.AbstractGroupedTable
          extended by inetsoft.report.filter.GroupFilter
All Implemented Interfaces:
GroupedTable, RegionTable, inetsoft.report.internal.table.CachedTableLens, StyleConstants, TableFilter, TableLens, XConstants, XTable, Serializable, Cloneable

public class GroupFilter
extends AbstractGroupedTable
implements Cloneable, inetsoft.report.internal.table.CachedTableLens

Table grouping filter. This filter groups rows in a table into sections. Each sections has a summary row, which contains results calculated by user supplied formulas. Grouping can be nested by using multiple columns for grouping. Each nested section has its own summary, with the enclosing section contains the summary of all enclosed sections. A grand total row can be added by supplying grand total formulas. The formula is used to accumulate summary information for the entire table, and appended at the end of the table.

GroupFilter can also be used to group rows without adding summary rows. To avoid summary rows being generated, pass a zero length summary column array to the GroupFilter constructor. Do not pass a null value.

Since group filter uses the sorting columns as the grouping column, if a grouping needs to be created with a subset of the sorting columns, the sorted table needs to be modified to return different sorting columns. This can be conveniently done by wrapping the sorted table in a DefaultSortedTable class, and specify a subset of the sorting columns in the DefaultSortedTable.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class inetsoft.report.filter.AbstractGroupedTable
AbstractGroupedTable.BooleanObject
 
Field Summary
 
Fields inherited from class inetsoft.report.lens.AbstractTableLens
descriptor, isLeftAlign
 
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
 
Fields inherited from interface inetsoft.report.filter.GroupedTable
GROUP_HEADER_FULL, GROUP_HEADER_IN_PLACE, GROUP_HEADER_ROWS
 
Constructor Summary
GroupFilter(SortedTable table)
          Create a GroupFilter that performs grouping only without any summarization.
GroupFilter(SortedTable table, int[][] grpcols, int[] sums, Formula[] calcs, Formula[] grand)
          Create a GroupFilter.
GroupFilter(SortedTable table, int[] sums, Formula[] calcs, Formula[] grand)
          Create a GroupFilter.
GroupFilter(SortedTable table, int[] sums, Formula calc, Formula grand)
          Create a GroupFilter.
GroupFilter(SortedTable table, int sum, Formula calc, Formula grand)
          Create a GroupFilter.
 
Method Summary
 SortedTable applyPostAggregateCondition(ConditionGroup conditions)
          Applies a post-aggregate condition to the base table.
 Object[] calculateSum(inetsoft.report.filter.AbstractGroupedTable.GroupHierarchy hierarchy)
          Calculate summary values for topn or sort by value for the hierarchy.
protected  void checkInit()
          Ensure table is initialized.
 void clearPageBreaks()
          Clear page breaks.
 void dispose()
          Dispose the table to clear up temporary resources.
 int firstSummaryColumn()
          Return the first summary column number.
 int getAlignment(int r, int c)
          Return the per cell alignment.
 Color getBackground(int r, int c)
          Return the per cell background color.
 int getBaseColIndex(int col)
          Get the base table column index corresponding to the filtered table.
 int getBaseRowIndex(int row)
          Get the base table row index corresponding to the grouped table.
 Color getColBorderColor(int r, int c)
          Return the color for drawing the column border lines.
 int getColCount()
          Return the number of columns in the table.
 Class getColType(int col)
          Get the current column content type.
 int getColWidth(int col)
          Get the current column width setting.
 TableDataDescriptor getDescriptor()
          Get internal table data descriptor which contains table structural infos.
 Font getFont(int r, int c)
          Return the per cell font.
 Color getForeground(int r, int c)
          Return the per cell foreground color.
 Formula getGrandFormula(int col)
          Get the grand formula of the column.
 String getGrandLabel()
          Get the grand total row label.
 int getGroupColCount()
          Return the number of grouping columns.
 int getGroupColLevel(int col)
          Get a group col's group level.
 int getGroupColumns(int level)
          Get the number of columns used in the specified grouping level.
protected  int getGroupFirstRow0(int row, int lvl)
          Internal method to get the first row at the specified row and group lvl.
 Formula getGroupFormula(int col)
          Get the group formula of the column.
 int getGroupHeaderStyle()
          Get the group header style.
 int getGroupLevel(int r)
          Get the grouping level of this group header.
 int getGroupLevel0(int r)
          Get the internal keep row level for the first row of a group.
 SortOrder getGroupOrder(int level)
          Get the group order information of a group level.
 SortOrder getGroupOrder(int[] cols)
          Deprecated. replaced by getGroupOrder(int level) Get the specific group order information.
 int getHeaderColCount()
          Return the number of columns on the left of the table to be treated as header columns.
 int getHeaderRowCount()
          Return the number of rows on the top of the table to be treated as header rows.
 Insets getInsets(int r, int c)
          Return the cell gap space.
 Object getObject(int r, int c)
          Return the value at the specified cell.
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 getRowBorder(int r, int c)
          Return the style for bottom border of the specified cell.
 Color getRowBorderColor(int r, int c)
          Return the color for drawing the row border lines.
 int getRowCount()
          Return the number of rows in the table.
 int getRowHeight(int row)
          Get the current row heights setting.
 String getSummaryLabel()
          Get summary row label format.
 int getSummaryLevel(int r)
          Get the grouping level of a summary row.
 TableLens getTable()
          Get the original table of this filter.
 int getTrailerColCount()
          Return the number of columns on the right-end of the table to be treated as trailer columns.
 int getTrailerRowCount()
          Return the number of rows on the bottom of the table to be treated as trailer rows.
 boolean hasGrandSummary()
          Check if this table contains grand total row.
 void invalidate()
          Invalidate the table filter forcely, and the table filter will perform filtering calculation to validate itself.
 boolean isAddGroupHeader()
          Check if group header is to be added to the grouped data.
 boolean isAggregateTopN()
          Check if only aggregate topN rows.
 boolean isBreakAfterSection()
          Deprecated. use setPageBreakLevels instead
 boolean isDefaultResult()
          Get the default result option of this filter.
 boolean isDetailRow(int row)
          Check if a row is detail row.
 boolean isGroupHeaderCell(int r, int c)
          Check if a cell is a group header cell.
 boolean isGroupHeaderRow(int r)
          Check if a row is displaying group header.
 boolean isHeaderDetailRow(int row)
          Check if a row is header detail row.
 boolean isLineWrap(int r, int c)
          Return the per cell line wrap mode.
 boolean isShowGroupColumns()
          Check if the first group column contents are shown.
 boolean isShowGroupColumns(int col)
          Check if a specified group column is show group columns, if the column is a aggregate or detail column, result is not correct.
 boolean isSubTotalHidden()
          Check if should hide subtotal for a single row option of this filter.
 boolean isSummarize(int level)
          Check if a grouping level is to be summarized.
 boolean isSummaryCol(int col)
          Check if a column is a summary column.
 boolean isSummaryRow(int row)
          Check if a row is a summary row.
 boolean moreRows(int row)
          Check if there are more rows.
 void setAddGroupHeader(boolean h)
          Set whether group headers are added to the table.
 void setAggregateTopN(boolean aggTopN)
          Set the option if only aggregate topN rows.
 void setBreakAfterSection(boolean pgbreak)
          Deprecated. use setPageBreakLevels instead
 void setDefaultResult(boolean def)
          Set the default result option of this filter.
 void setGrandLabel(String label)
          Set the grand total label.
 void setGrandSummary(boolean total)
          Set if grand total row will be appended to the end of table.
 void setGroupHeaderStyle(int headerS)
          Set the group header style.
 void setGroupOrder(int[] cols, SortOrder order)
          Deprecated. replaced by setGroupOrder(int level, SortOrder order) Set the specific group order information.

When construct the filter, the init(inetsoft.report.filter.SortedTable, int[], inetsoft.report.filter.Formula[]) method will be called, which will generate a column map to display group columns from left to right.

 void setGroupOrder(int level, SortOrder order)
          Set the specific group order information.
 void setObject(int r, int c, Object v)
          Set the cell value.
 void setPageBreakLevels(BitSet lvlset)
          Set page break levels.
 void setShowGroupColumns(boolean grp)
          Set the show group column contents option.
 void setShowGroupColumns(boolean[] grps)
          Set show group columns value for all group columns, if the value size is less than the group column count, than we will use the previous avaliable group column index instead of use the out of bounds group column.
 void setSubTotalHidden(boolean subTotalHidden)
          Set the hide subtotal for a single row option of this filter.
 void setSummarize(int level, boolean sum)
          Set if a grouping level is to be summarized.
 void setSummaryLabel(String fmt)
          Set the summary row label.
 void setTable(TableLens table)
          Set the base table of this filter.
 void setTopN(int groupLevel, inetsoft.report.internal.binding.TopNInfo info)
          Set topn info to recalculate summary value.
 
Methods inherited from class inetsoft.report.filter.AbstractGroupedTable
clearCache, getAvailableLevels, getColumnIdentifier, getGroupFirstRow, getGroupFirstRow, getGroupLastRow, getGroupLastRow, getGroupLastRow0, getHeader2, getMergedGroup, getRealGroupColCount, getSpan, isMergedGroup, isMergeGroupCells, setMergedGroup, setMergeGroupCells
 
Methods inherited from class inetsoft.report.lens.AbstractTableLens
addChangeListener, clone, containsDrill, containsFormat, findColumnByIdentifier, fireChangeEvent, getBoolean, getByte, getColBorder, getDefaultFormat, getDouble, getFloat, getInt, getLong, getShort, getXDrillInfo, isNull, isPrimitive, removeChangeListener, setColumnIdentifier, setLeftAlign, setLocal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface inetsoft.report.internal.table.CachedTableLens
clearCache
 
Methods inherited from interface inetsoft.report.TableLens
addChangeListener, containsDrill, containsFormat, getColBorder, getDefaultFormat, getSpan, getXDrillInfo, removeChangeListener
 
Methods inherited from interface inetsoft.uql.XTable
getBoolean, getByte, getColumnIdentifier, getDouble, getFloat, getInt, getLong, getShort, isNull, isPrimitive, setColumnIdentifier
 

Constructor Detail

GroupFilter

public GroupFilter(SortedTable table)
Create a GroupFilter that performs grouping only without any summarization.

Parameters:
table - sorted table.

GroupFilter

public GroupFilter(SortedTable table,
                   int sum,
                   Formula calc,
                   Formula grand)
Create a GroupFilter. The sorting columns in the sorted table are used for grouping.

Parameters:
table - sorted table.
sum - summary column.
calc - summary formula.
grand - grand total formula.

GroupFilter

public GroupFilter(SortedTable table,
                   int[] sums,
                   Formula calc,
                   Formula grand)
Create a GroupFilter. The sorting columns in the sorted table are used for grouping.

Parameters:
table - sorted table.
sums - summary columns.
calc - summary formula.
grand - grand total formula.

GroupFilter

public GroupFilter(SortedTable table,
                   int[] sums,
                   Formula[] calcs,
                   Formula[] grand)
Create a GroupFilter. The sorting columns in the sorted table are used for grouping.

Parameters:
table - sorted table.
sums - summary columns.
calcs - summary formulas.
grand - grand total formulas.

GroupFilter

public GroupFilter(SortedTable table,
                   int[][] grpcols,
                   int[] sums,
                   Formula[] calcs,
                   Formula[] grand)
Create a GroupFilter. The sorting columns in the sorted table are used for grouping.

Parameters:
table - sorted table.
grpcols - grouping columns. The columns are passed in as two dimensional array. Each sub-array specifies one group. More than one column can be specified in a group. The columns specified in the grpcols must already be sorted.
sums - summary columns.
calcs - summary formulas.
grand - grand total formulas.
Method Detail

applyPostAggregateCondition

public SortedTable applyPostAggregateCondition(ConditionGroup conditions)
Applies a post-aggregate condition to the base table. The specified conditions are evaluated against the inner-most group aggregates of this table. This method returns the detail rows that compose the matching groups.

Parameters:
conditions - the conditions to apply.
Returns:
the matching detail rows or null if the conditions match all rows of the table.

setGroupOrder

public void setGroupOrder(int[] cols,
                          SortOrder order)
Deprecated. replaced by setGroupOrder(int level, SortOrder order) Set the specific group order information.

When construct the filter, the init(inetsoft.report.filter.SortedTable, int[], inetsoft.report.filter.Formula[]) method will be called, which will generate a column map to display group columns from left to right.

Parameters:
cols - group columns
order - group order

getGroupOrder

public SortOrder getGroupOrder(int[] cols)
Deprecated. replaced by getGroupOrder(int level) Get the specific group order information.

Parameters:
cols - group columns
Returns:
the group order information. Null means not existent

setGroupOrder

public void setGroupOrder(int level,
                          SortOrder order)
Set the specific group order information.

Parameters:
level - the specified group level.
order - group order.

getGroupOrder

public SortOrder getGroupOrder(int level)
Get the group order information of a group level.

Parameters:
level - the specified group level
Returns:
the group order information. Null means not existent

getGroupColCount

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

Specified by:
getGroupColCount in interface GroupedTable
Specified by:
getGroupColCount in class AbstractGroupedTable

getGroupColumns

public 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
Specified by:
getGroupColumns in class AbstractGroupedTable

getGroupColLevel

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

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

setTable

public void setTable(TableLens table)
Set the base table of this filter. The base table must be a sorted table.

Specified by:
setTable in interface TableFilter

getTable

public TableLens getTable()
Get the original table of this filter.

Specified by:
getTable in interface TableFilter
Returns:
the original table of this filter

setDefaultResult

public void setDefaultResult(boolean def)
Set the default result option of this filter.

Parameters:
def - true to use the default value of a formula if no result, false to just return null.

isDefaultResult

public boolean isDefaultResult()
Get the default result option of this filter.

Returns:
true to use the default value of a formula if no result, false to just return null.

setSubTotalHidden

public void setSubTotalHidden(boolean subTotalHidden)
Set the hide subtotal for a single row option of this filter.

Parameters:
subTotalHidden - whether hide subtotal for a single row.

isSubTotalHidden

public boolean isSubTotalHidden()
Check if should hide subtotal for a single row option of this filter.

Returns:
true if should hide subtotal for a single row, false otherwise.

setAggregateTopN

public void setAggregateTopN(boolean aggTopN)
Set the option if only aggregate topN rows.

Parameters:
aggTopN - true to aggregate only topN rows.

isAggregateTopN

public boolean isAggregateTopN()
Check if only aggregate topN rows.


getDescriptor

public TableDataDescriptor getDescriptor()
Get internal table data descriptor which contains table structural infos.

Specified by:
getDescriptor in interface TableLens
Specified by:
getDescriptor in interface XTable
Overrides:
getDescriptor in class AbstractTableLens
Returns:
table data descriptor.

getTrailerRowCount

public int getTrailerRowCount()
Return the number of rows on the bottom of the table to be treated as trailer rows.

Specified by:
getTrailerRowCount in interface XTable
Overrides:
getTrailerRowCount in class AbstractTableLens
Returns:
number of header rows.

getTrailerColCount

public int getTrailerColCount()
Return the number of columns on the right-end of the table to be treated as trailer columns.

Specified by:
getTrailerColCount in interface XTable
Overrides:
getTrailerColCount in class AbstractTableLens
Returns:
number of trailer columns.

isAddGroupHeader

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

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

setAddGroupHeader

public 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
Specified by:
setAddGroupHeader in class AbstractGroupedTable

isShowGroupColumns

public boolean isShowGroupColumns()
Check if the first group column contents are shown.

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

isShowGroupColumns

public boolean isShowGroupColumns(int col)
Check if a specified group column is show group columns, if the column is a aggregate or detail column, result is not correct. This is true by default. If it's false, the group column is hidden.

Returns:
true if group columns are shown.

setShowGroupColumns

public 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
Specified by:
setShowGroupColumns in class AbstractGroupedTable
Parameters:
grp - show group column contents.

setShowGroupColumns

public void setShowGroupColumns(boolean[] grps)
Set show group columns value for all group columns, if the value size is less than the group column count, than we will use the previous avaliable group column index instead of use the out of bounds group column.


isSummarize

public boolean isSummarize(int level)
Check if a grouping level is to be summarized.


setSummarize

public void setSummarize(int level,
                         boolean sum)
Set if a grouping level is to be summarized.

Parameters:
level - the group level, -1 for grand total level.
sum - true to enable the group summarization.

getGroupHeaderStyle

public int getGroupHeaderStyle()
Get the group header style.

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

setGroupHeaderStyle

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

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

isBreakAfterSection

public boolean isBreakAfterSection()
Deprecated. use setPageBreakLevels instead

Check is a page break is inserted after each section.

Returns:
true if page break is inserted

setBreakAfterSection

public void setBreakAfterSection(boolean pgbreak)
Deprecated. use setPageBreakLevels instead

Set the option to insert a page break following each section.

Parameters:
pgbreak - true to insert page breaks

setGrandLabel

public void setGrandLabel(String label)
Set the grand total label. It is displayed in the first column on the grand total row. By default there is no label.

Parameters:
label - grand total label.

getGrandLabel

public String getGrandLabel()
Get the grand total row label.

Returns:
grand total label.

setPageBreakLevels

public void setPageBreakLevels(BitSet lvlset)
Set page break levels.

Parameters:
lvlset - the page break levels.

getPageBreakLevels

public BitSet getPageBreakLevels()
Get page break levels.

Overrides:
getPageBreakLevels in class AbstractGroupedTable
Returns:
page break levels.

isGroupHeaderRow

public boolean isGroupHeaderRow(int r)
Check if a row is displaying group header. This does not flag a in-place header row as a header row because it also contains body cells.

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

isGroupHeaderCell

public 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
Specified by:
isGroupHeaderCell in class AbstractGroupedTable
Parameters:
r - row number.
c - column number.
Returns:
true if the cell is a group header cell.

getGroupLevel

public 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
Specified by:
getGroupLevel in class AbstractGroupedTable
Returns:
grouping level. The top-most group is level 0. Returns -1 if the row is not a header row.

getGroupLevel0

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

Overrides:
getGroupLevel0 in class AbstractGroupedTable

isDetailRow

public boolean isDetailRow(int row)
Check if a row is detail row.

Parameters:
row - the specified row
Returns:
true if is detail row, false otherwise

isHeaderDetailRow

public boolean isHeaderDetailRow(int row)
Check if a row is header detail row.

Parameters:
row - the specified row
Returns:
true if is header detail row, false otherwise

isSummaryRow

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

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

isSummaryCol

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

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

getSummaryLevel

public 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
Specified by:
getSummaryLevel in class AbstractGroupedTable
Returns:
grouping level. The top-most group is level 0. Returns -1 if the row is not a summary row.

setGrandSummary

public void setGrandSummary(boolean total)
Set if grand total row will be appended to the end of table.

The grand total row will only be append to the end of table when it be set to true and the grand total level summarization formula array is not null or a zero length array.

Parameters:
total - true to add a grand total row in the end.

hasGrandSummary

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

Specified by:
hasGrandSummary in interface GroupedTable
Specified by:
hasGrandSummary in class AbstractGroupedTable
Returns:
true if grand total row exists.

setSummaryLabel

public void setSummaryLabel(String fmt)
Set the summary row label. This label can be specified as a message format conforming to java.text.MessageFormat specification. The group column values are passed to the format as arguments that can be replaced in the format. For example, a label can be 'Total Sales for {0}', where {0} will be replaced by the group column value for the group.


getSummaryLabel

public String getSummaryLabel()
Get summary row label format.


invalidate

public void invalidate()
Invalidate the table filter forcely, and the table filter will perform filtering calculation to validate itself.

Specified by:
invalidate in interface TableFilter

getGroupFormula

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

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

getGrandFormula

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

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

calculateSum

public Object[] calculateSum(inetsoft.report.filter.AbstractGroupedTable.GroupHierarchy hierarchy)
Calculate summary values for topn or sort by value for the hierarchy.

Overrides:
calculateSum in class AbstractGroupedTable

getBaseRowIndex

public 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
Specified by:
getBaseRowIndex in class AbstractGroupedTable
Parameters:
row - row index in the grouped table.
Returns:
corresponding row index in the base table.

getBaseColIndex

public int getBaseColIndex(int col)
Get the base table column index corresponding to the filtered table. If the column does not exist in the base table, it returns -1.

Specified by:
getBaseColIndex in interface TableFilter
Parameters:
col - column index in the filtered table.
Returns:
corresponding column index in the bast table.

moreRows

public boolean moreRows(int row)
Check if there are more rows. The row index is the row that will be accessed. This method must block until the row is available, or return false if the row does not exist in the table. This method is used to iterate through the table, and allow partial table to be accessed in report processing.

Specified by:
moreRows in interface XTable
Overrides:
moreRows in class AbstractTableLens
Parameters:
row - row number.
Returns:
true if the row exists, or false if no more rows.

getRowCount

public int getRowCount()
Return the number of rows in the table. The number of rows includes the header rows.

Specified by:
getRowCount in interface XTable
Returns:
number of rows in table.

getColCount

public int getColCount()
Return the number of columns in the table. The number of columns includes the header columns.

Specified by:
getColCount in interface XTable
Returns:
number of columns in table.

getColType

public Class getColType(int col)
Get the current column content type.

Specified by:
getColType in interface XTable
Overrides:
getColType in class AbstractTableLens
Parameters:
col - column number.
Returns:
column type.

getHeaderRowCount

public int getHeaderRowCount()
Return the number of rows on the top of the table to be treated as header rows.

Specified by:
getHeaderRowCount in interface XTable
Overrides:
getHeaderRowCount in class AbstractTableLens
Returns:
number of header rows.

getHeaderColCount

public int getHeaderColCount()
Return the number of columns on the left of the table to be treated as header columns.

Specified by:
getHeaderColCount in interface XTable
Overrides:
getHeaderColCount in class AbstractTableLens

getRowHeight

public int getRowHeight(int row)
Get the current row heights setting. The meaning of row heights depends on the table layout policy setting. If the row height is to be calculated by the ReportSheet based on the content, return -1.

Specified by:
getRowHeight in interface TableLens
Overrides:
getRowHeight in class AbstractTableLens
Returns:
row height.

getColWidth

public int getColWidth(int col)
Get the current column width setting. The meaning of column widths depends on the table layout policy setting. If the column width is to be calculated by the ReportSheet based on the content, return -1. A special value, StyleConstants.REMAINDER, can be returned by this method to indicate that width of this column should be calculated based on the remaining space after all other columns' widths are satisfied. If there are more than one column that return REMAINDER as their widths, the remaining space is distributed evenly among these columns.

Specified by:
getColWidth in interface TableLens
Overrides:
getColWidth in class AbstractTableLens
Returns:
column width.

getRowBorderColor

public Color getRowBorderColor(int r,
                               int c)
Return the color for drawing the row border lines.

Specified by:
getRowBorderColor in interface TableLens
Overrides:
getRowBorderColor in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
ruling color.

getColBorderColor

public Color getColBorderColor(int r,
                               int c)
Return the color for drawing the column border lines.

Specified by:
getColBorderColor in interface TableLens
Overrides:
getColBorderColor in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
ruling color.

getRowBorder

public int getRowBorder(int r,
                        int c)
Return the style for bottom border of the specified cell. The flag must be one of the style options defined in the StyleConstants class. If the row number is -1, it's checking the outside ruling on the top.

Specified by:
getRowBorder in interface TableLens
Overrides:
getRowBorder in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
ruling flag.

getInsets

public Insets getInsets(int r,
                        int c)
Return the cell gap space.

Specified by:
getInsets in interface TableLens
Overrides:
getInsets in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
cell gap space.

getAlignment

public int getAlignment(int r,
                        int c)
Return the per cell alignment.

Specified by:
getAlignment in interface TableLens
Overrides:
getAlignment in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
cell alignment.

getFont

public Font getFont(int r,
                    int c)
Return the per cell font. Return null to use default font.

Specified by:
getFont in interface TableLens
Overrides:
getFont in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
font for the specified cell.

isLineWrap

public boolean isLineWrap(int r,
                          int c)
Return the per cell line wrap mode. If the line wrap mode is true, lines are wrapped when the text can not fit on one line. Otherwise the wrapping is never done and any overflow text will be truncated.

Specified by:
isLineWrap in interface TableLens
Overrides:
isLineWrap in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
true if line wrapping should be done.

getForeground

public Color getForeground(int r,
                           int c)
Return the per cell foreground color. Return null to use default color.

Specified by:
getForeground in interface TableLens
Overrides:
getForeground in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
foreground color for the specified cell.

getBackground

public Color getBackground(int r,
                           int c)
Return the per cell background color. Return null to use default color.

Specified by:
getBackground in interface TableLens
Overrides:
getBackground in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
background color for the specified cell.

getObject

public Object getObject(int r,
                        int c)
Return the value at the specified cell.

Specified by:
getObject in interface XTable
Parameters:
r - row number.
c - column number.
Returns:
the value at the location.

setObject

public void setObject(int r,
                      int c,
                      Object v)
Set the cell value.

Specified by:
setObject in interface XTable
Overrides:
setObject in class AbstractTableLens
Parameters:
r - row number.
c - column number.
v - cell value.

checkInit

protected final void checkInit()
Ensure table is initialized.


firstSummaryColumn

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

Overrides:
firstSummaryColumn in class AbstractGroupedTable

dispose

public void dispose()
Dispose the table to clear up temporary resources.

Specified by:
dispose in interface XTable
Overrides:
dispose in class AbstractTableLens

clearPageBreaks

public void clearPageBreaks()
Clear page breaks.

Overrides:
clearPageBreaks in class AbstractGroupedTable

getOriginalPath

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

Overrides:
getOriginalPath in class AbstractGroupedTable
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.

setTopN

public void setTopN(int groupLevel,
                    inetsoft.report.internal.binding.TopNInfo info)
Set topn info to recalculate summary value.


getGroupFirstRow0

protected int getGroupFirstRow0(int row,
                                int lvl)
Description copied from class: AbstractGroupedTable
Internal method to get the first row at the specified row and group lvl.

Overrides:
getGroupFirstRow0 in class AbstractGroupedTable
Parameters:
row - the specified row
lvl - the specified group lvl
Returns:
the first row, -1 if the group first row is not found.

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