|
Style Intelligence v12.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectinetsoft.report.lens.AbstractTableLens
inetsoft.report.filter.AbstractGroupedTable
inetsoft.report.filter.GroupFilter
public class GroupFilter
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.
| 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.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 |
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 |
|---|
public GroupFilter(SortedTable table)
table - sorted table.
public GroupFilter(SortedTable table,
int sum,
Formula calc,
Formula grand)
table - sorted table.sum - summary column.calc - summary formula.grand - grand total formula.
public GroupFilter(SortedTable table,
int[] sums,
Formula calc,
Formula grand)
table - sorted table.sums - summary columns.calc - summary formula.grand - grand total formula.
public GroupFilter(SortedTable table,
int[] sums,
Formula[] calcs,
Formula[] grand)
table - sorted table.sums - summary columns.calcs - summary formulas.grand - grand total formulas.
public GroupFilter(SortedTable table,
int[][] grpcols,
int[] sums,
Formula[] calcs,
Formula[] grand)
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 |
|---|
public SortedTable applyPostAggregateCondition(ConditionGroup conditions)
conditions - the conditions to apply.
public void setGroupOrder(int[] cols,
SortOrder order)
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.
cols - group columnsorder - group orderpublic SortOrder getGroupOrder(int[] cols)
getGroupOrder(int level)
Get the specific group order information.
cols - group columns
Null means not existent
public void setGroupOrder(int level,
SortOrder order)
level - the specified group level.order - group order.public SortOrder getGroupOrder(int level)
level - the specified group level
Null means not existentpublic int getGroupColCount()
getGroupColCount in interface GroupedTablegetGroupColCount in class AbstractGroupedTablepublic int getGroupColumns(int level)
getGroupColumns in interface GroupedTablegetGroupColumns in class AbstractGroupedTablepublic int getGroupColLevel(int col)
getGroupColLevel in interface GroupedTablegetGroupColLevel in class AbstractGroupedTablecol - the group col
-1 means not a group colpublic void setTable(TableLens table)
setTable in interface TableFilterpublic TableLens getTable()
getTable in interface TableFilterpublic void setDefaultResult(boolean def)
def - true to use the default value of a formula if no
result, false to just return null.public boolean isDefaultResult()
public void setSubTotalHidden(boolean subTotalHidden)
subTotalHidden - whether hide subtotal for a single row.public boolean isSubTotalHidden()
public void setAggregateTopN(boolean aggTopN)
aggTopN - true to aggregate only topN rows.public boolean isAggregateTopN()
public TableDataDescriptor getDescriptor()
getDescriptor in interface TableLensgetDescriptor in interface XTablegetDescriptor in class AbstractTableLenspublic int getTrailerRowCount()
getTrailerRowCount in interface XTablegetTrailerRowCount in class AbstractTableLenspublic int getTrailerColCount()
getTrailerColCount in interface XTablegetTrailerColCount in class AbstractTableLenspublic boolean isAddGroupHeader()
isAddGroupHeader in interface GroupedTableisAddGroupHeader in class AbstractGroupedTablepublic void setAddGroupHeader(boolean h)
setAddGroupHeader in interface GroupedTablesetAddGroupHeader in class AbstractGroupedTablepublic boolean isShowGroupColumns()
isShowGroupColumns in interface GroupedTableisShowGroupColumns in class AbstractGroupedTablepublic boolean isShowGroupColumns(int col)
public void setShowGroupColumns(boolean grp)
setShowGroupColumns in interface GroupedTablesetShowGroupColumns in class AbstractGroupedTablegrp - show group column contents.public void setShowGroupColumns(boolean[] grps)
public boolean isSummarize(int level)
public void setSummarize(int level,
boolean sum)
level - the group level, -1 for grand total level.sum - true to enable the group summarization.public int getGroupHeaderStyle()
getGroupHeaderStyle in interface GroupedTablegetGroupHeaderStyle in class AbstractGroupedTablepublic void setGroupHeaderStyle(int headerS)
setGroupHeaderStyle in interface GroupedTablesetGroupHeaderStyle in class AbstractGroupedTableheaderS - one of GROUP_HEADER_IN_PLACE, GROUP_HEADER_ROWS (default).public boolean isBreakAfterSection()
public void setBreakAfterSection(boolean pgbreak)
pgbreak - true to insert page breakspublic void setGrandLabel(String label)
label - grand total label.public String getGrandLabel()
public void setPageBreakLevels(BitSet lvlset)
lvlset - the page break levels.public BitSet getPageBreakLevels()
getPageBreakLevels in class AbstractGroupedTablepublic boolean isGroupHeaderRow(int r)
isGroupHeaderRow in interface GroupedTableisGroupHeaderRow in class AbstractGroupedTabler - row number.
public boolean isGroupHeaderCell(int r,
int c)
isGroupHeaderCell in interface GroupedTableisGroupHeaderCell in interface RegionTableisGroupHeaderCell in class AbstractGroupedTabler - row number.c - column number.
public int getGroupLevel(int r)
getGroupLevel in interface GroupedTablegetGroupLevel in interface RegionTablegetGroupLevel in class AbstractGroupedTablepublic int getGroupLevel0(int r)
getGroupLevel0 in class AbstractGroupedTablepublic boolean isDetailRow(int row)
row - the specified row
public boolean isHeaderDetailRow(int row)
row - the specified row
public boolean isSummaryRow(int row)
isSummaryRow in interface GroupedTableisSummaryRow in interface RegionTableisSummaryRow in class AbstractGroupedTablerow - the row number.
public boolean isSummaryCol(int col)
isSummaryCol in interface GroupedTableisSummaryCol in class AbstractGroupedTablecol - the column number.
public int getSummaryLevel(int r)
getSummaryLevel in interface GroupedTablegetSummaryLevel in interface RegionTablegetSummaryLevel in class AbstractGroupedTablepublic void setGrandSummary(boolean total)
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.
total - true to add a grand total row in the end.public boolean hasGrandSummary()
hasGrandSummary in interface GroupedTablehasGrandSummary in class AbstractGroupedTablepublic void setSummaryLabel(String fmt)
public String getSummaryLabel()
public void invalidate()
invalidate in interface TableFilterpublic Formula getGroupFormula(int col)
getGroupFormula in interface GroupedTablegetGroupFormula in class AbstractGroupedTablecol - column index in the grouped table.
public Formula getGrandFormula(int col)
getGrandFormula in interface GroupedTablegetGrandFormula in class AbstractGroupedTablecol - column index in the grouped table.
public Object[] calculateSum(inetsoft.report.filter.AbstractGroupedTable.GroupHierarchy hierarchy)
calculateSum in class AbstractGroupedTablepublic int getBaseRowIndex(int row)
getBaseRowIndex in interface GroupedTablegetBaseRowIndex in interface TableFiltergetBaseRowIndex in class AbstractGroupedTablerow - row index in the grouped table.
public int getBaseColIndex(int col)
getBaseColIndex in interface TableFiltercol - column index in the filtered table.
public boolean moreRows(int row)
moreRows in interface XTablemoreRows in class AbstractTableLensrow - row number.
public int getRowCount()
getRowCount in interface XTablepublic int getColCount()
getColCount in interface XTablepublic Class getColType(int col)
getColType in interface XTablegetColType in class AbstractTableLenscol - column number.
public int getHeaderRowCount()
getHeaderRowCount in interface XTablegetHeaderRowCount in class AbstractTableLenspublic int getHeaderColCount()
getHeaderColCount in interface XTablegetHeaderColCount in class AbstractTableLenspublic int getRowHeight(int row)
getRowHeight in interface TableLensgetRowHeight in class AbstractTableLenspublic int getColWidth(int col)
getColWidth in interface TableLensgetColWidth in class AbstractTableLens
public Color getRowBorderColor(int r,
int c)
getRowBorderColor in interface TableLensgetRowBorderColor in class AbstractTableLensr - row number.c - column number.
public Color getColBorderColor(int r,
int c)
getColBorderColor in interface TableLensgetColBorderColor in class AbstractTableLensr - row number.c - column number.
public int getRowBorder(int r,
int c)
getRowBorder in interface TableLensgetRowBorder in class AbstractTableLensr - row number.c - column number.
public Insets getInsets(int r,
int c)
getInsets in interface TableLensgetInsets in class AbstractTableLensr - row number.c - column number.
public int getAlignment(int r,
int c)
getAlignment in interface TableLensgetAlignment in class AbstractTableLensr - row number.c - column number.
public Font getFont(int r,
int c)
getFont in interface TableLensgetFont in class AbstractTableLensr - row number.c - column number.
public boolean isLineWrap(int r,
int c)
isLineWrap in interface TableLensisLineWrap in class AbstractTableLensr - row number.c - column number.
public Color getForeground(int r,
int c)
getForeground in interface TableLensgetForeground in class AbstractTableLensr - row number.c - column number.
public Color getBackground(int r,
int c)
getBackground in interface TableLensgetBackground in class AbstractTableLensr - row number.c - column number.
public Object getObject(int r,
int c)
getObject in interface XTabler - row number.c - column number.
public void setObject(int r,
int c,
Object v)
setObject in interface XTablesetObject in class AbstractTableLensr - row number.c - column number.v - cell value.protected final void checkInit()
public int firstSummaryColumn()
firstSummaryColumn in class AbstractGroupedTablepublic void dispose()
dispose in interface XTabledispose in class AbstractTableLenspublic void clearPageBreaks()
clearPageBreaks in class AbstractGroupedTable
protected TableDataPath getOriginalPath(TableDataPath path,
AbstractGroupedTable.BooleanObject aggregated,
boolean special)
getOriginalPath in class AbstractGroupedTablepath - 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.
public void setTopN(int groupLevel,
inetsoft.report.internal.binding.TopNInfo info)
protected int getGroupFirstRow0(int row,
int lvl)
AbstractGroupedTable
getGroupFirstRow0 in class AbstractGroupedTablerow - the specified rowlvl - the specified group lvl
|
Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||