Style Intelligence v12.0

inetsoft.report.filter
Class CrossTabFilter

java.lang.Object
  extended by inetsoft.report.lens.AbstractTableLens
      extended by inetsoft.report.filter.CrossTabFilter
All Implemented Interfaces:
CalcFilter, Crosstab, StyleConstants, TableFilter, TableLens, XConstants, XTable, Serializable, Cloneable
Direct Known Subclasses:
CrossTabCubeFilter

public class CrossTabFilter
extends AbstractTableLens
implements TableFilter, Crosstab, CalcFilter, Cloneable

Create a crosstab table. A crosstab table uses one column as the row header, and one column as the column header. The data at the cross section of rows and columns are extracted from the original table. If a formula is supplied, the data item is an accumulation of the data for the row/column header. If there are more than one row with the row/column header value, the data is extracted from the rows and added to the formula to obtain the final value. If no formula is supplied, the data cell at the crosstab is the value or the row with the row/column header. If more than one row have the same row/column, the last row value is used.

For example, a table containing:

 R1     C1      5
 R1     C1      4
 ...
 
With the first column used as the row header, and second column as the column header, and the third column as the data column, a cross tab table containing the following will be created:

C1 R1 4

If a SumFormula is supplied, the result table will be:

C1 R1 9

See Also:
Serialized Form

Field Summary
static String COL_GRAND_TOTAL_HEADER
          Col grand total header in table data path.
protected  Map levels
           
protected  Map minfos
           
static String ROW_GRAND_TOTAL_HEADER
          Row grand total header in table data path.
 
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
 
Constructor Summary
CrossTabFilter(TableLens table, int[] rowh, int[] colh, int[] dcol, Formula[] sum)
          Create a crosstab table with the specified row, column, and data columns.
CrossTabFilter(TableLens table, int[] rowh, int[] colh, int dcol, Formula sum)
          Create a crosstab table with the specified row, column, and data columns.
CrossTabFilter(TableLens table, int[] rowh, int colh, int[] dcol, Formula[] sum)
          Create a crosstab table with the specified row, column, and data columns.
CrossTabFilter(TableLens table, int[] rowh, int colh, int dcol, Formula sum)
          Create a crosstab table with the specified row, column, and data columns.
CrossTabFilter(TableLens table, int rowh, int[] colh, int[] dcol, Formula[] sum)
          Create a crosstab table with the specified row, column, and data columns.
CrossTabFilter(TableLens table, int rowh, int[] colh, int dcol, Formula sum)
          Create a crosstab table with the specified row, column, and data columns.
CrossTabFilter(TableLens table, int rowh, int colh, int[] dcol, Formula[] sum)
          Create a crosstab table with the specified row, column, and data columns.
CrossTabFilter(TableLens table, int rowh, int colh, int dcol, Formula sum)
          Create a crosstab table with the specified row, column, and data columns.
 
Method Summary
 boolean containsColSortByVal(int ccol)
          Test if a col header contains sort by value info.
 boolean containsColTopN(int ccol)
          Test if a col header contains topn.
 boolean containsRowSortByVal(int rcol)
          Test if a row header contains sort by value info.
 boolean containsRowTopN(int rcol)
          Test if a row header contains topn.
protected  void createXMetaInfo()
          Create the meta info.
 void dispose()
          Dispose the table to clear up temporary resources.
 int getAlignment(int r, int c)
          Return the per cell alignment.
 String[] getAvailableFields(int row, int col)
          Get available fields of a crosstab cell.
 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 filtered table.
 int getColBorder(int r, int c)
          Return the style for right border of the specified row.
 Color getColBorderColor(int r, int c)
          Return the color for drawing the column border lines.
 Comparer getColComparer()
          Get the column comparer used for comparison of column header values.
 Comparer getColComparer(int hdridx)
          Get the comparer used for comparison of column header values.
 int getColCount()
          Return the number of columns in the table.
 String getColHeader(int idx)
          Get col header name.
 int getColHeaderCount()
          Get the column header count.
 int getColWidth(int col)
          Get the current column width setting.
 int getDataColCount()
          Return the number one or more data columns
 Comparer getDataComparer(int col)
          Get the comparer for a data column.
 String getDataHeader(int idx)
          Get data header name.
 String getDataName(int row, int col)
          Get a data cell's name.
 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.
 CrosstabGrid getGrid()
          Get the crosstab grid type.
 Object getHeader(Object header)
          Get the mapping name of the header.
protected  String getHeader0(int index)
          Get header content.
 int getHeaderColCount()
          Return the number of columns on the left of the table to be treated as header columns.
 String getHeaderName(int row, int col)
          Get a header cell's header name.
 int getHeaderRowCount()
          Return the number of rows on the top of the table to be treated as header rows.
 Object[] getHeaders()
          Get header at an index in base table.
 Insets getInsets(int r, int c)
          Return the cell gap space.
 Map getKeyValuePairs(int row, int col, Map map)
          Create key value paires for hyperlink and condition to use.
 Object getObject(int r, int c)
          Return the value at the specified cell.
 int getPercentageDirection()
          Return percentage direction.
 Format getPercentFormat()
          Get the format used to show percentages.
 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.
 Object getRowColumnHeader(int idx)
          Get the row column's header.
 Comparer getRowComparer()
          Get the comparer used for comparison of row header values.
 Comparer getRowComparer(int hdridx)
          Get the comparer used for comparison of row header values.
 int getRowCount()
          Return the number of rows in the table.
 String getRowHeader(int idx)
          Get row header name.
 int getRowHeaderCount()
          Get the row header count.
 int getRowHeight(int row)
          Get the current row heights setting.
 Dimension getSpan(int r, int c)
          Return the spanning setting for the cell.
 int getStyleCol(int c)
          Get the column to be base style.
 boolean[] getSuppressColumnGroupTotal()
          Check if the col group total is suppressed.
 boolean[] getSuppressRowGroupTotal()
          Check if the row group total is suppressed.
 TableLens getTable()
          Get the base table.
 String getTotalLabel()
          Get the label string for total columns and rows.
 int getTrailerColCount()
          Return the number of columns on the right of the table to be treated as tail columns.
 int getTrailerRowCount()
          Return the number of rows on the bottom of the table to be treated as tail rows.
 void invalidate()
          Invalidate the table filter forcely, and the table filter will perform filtering calculation to validate itself.
 boolean isAggregateTopN()
          Check if only aggregate topN rows.
 boolean isColumnTotalOnFirst()
          Check if the col total is on first col.
 boolean isDataCell(int row, int col)
          Test if the cell is a data cell.
 boolean isFillBlankWithZero()
          Check if column headers are kept.
 boolean isGrandTotalCell(int row, int col)
          Test if the cell is a grandtotal cell.
 boolean isHeaderCell(int row, int col)
          Test if the cell is a header cell.
 boolean isKeepColumnHeaders()
          Check if column headers are kept.
 boolean isRepeatRowLabels()
          Check if the row label are repeated.
 boolean isRowTotalOnTop()
          Check if the row total is on top.
 boolean isShowSummaryHeaders()
          Check whether to add summary title row/column.
 boolean isSummarySideBySide()
          Check if summary cells are put side by side.
 boolean isSuppressColumnGrandTotal()
          Check if the col grand total is suppressed.
 boolean isSuppressColumnGroupTotal(int i)
          Check if the col group total is suppressed.
 boolean isSuppressColumnSubtotal()
          Check if the col subtotal is suppressed.
 boolean isSuppressRowGrandTotal()
          Check if the row grand total is suppressed.
 boolean isSuppressRowGroupTotal(int i)
          Check if the row group total is suppressed.
 boolean isSuppressRowSubtotal()
          Check if the row subtotal is suppressed.
 void removeColSortByVal(int ccol)
          Remove col header sort by value info.
 void removeColTopN(int ccol)
          Remove col header topn.
 void removeRowSortByVal(int rcol)
          Remove row header sort value info.
 void removeRowTopN(int rcol)
          Remove row header topn.
 void setAggregateTopN(boolean aggTopN)
          Set the option if only aggregate topN rows.
 void setColHeaderComparer(Comparer comp)
          Set the column header comparer used for comparison of column header values.
 void setColHeaderComparer(int hdridx, Comparer comp)
          Set the column header comparer used for comparison of column header values.
 void setColSortByValInfo(int ccol, int dcol, boolean reverse)
          Set col header sort by value info.
 void setColTopN(int ccol, int dcol, int topn, boolean reverse, boolean others)
          Set col header topn.
 void setColumnTotalOnFirst(boolean first)
          Set option to set the col total area on first col of the group.
 void setCondition(ConditionGroup condition)
          Set condition.
 void setDataComparer(int col, Comparer comp)
          Set the comparer for a data column.
 void setFillBlankWithZero(boolean fill)
          Set option to fill blank cell with zero.
 void setGrid(CrosstabGrid grid)
          Set the crosstab grid type.
 void setHeader(Object header, Object str)
          Set the mapping name of specified header.
 void setKeepColumnHeaders(boolean keep)
          Set option to keep column headers.
 void setMeasureNames(String[] names)
          Set the measure names to table.
 void setObject(int r, int c, Object v)
          Set the cell value.
 void setPercentageDirection(int percentageDir)
          Set percentage direction.
 void setPercentFormat(Format fmt)
          Set the format used to show percentages.
 void setRepeatRowLabels(boolean repeat)
          Set option to repeat row labels.
 void setRowHeaderComparer(Comparer comp)
          Set the row header comparer used for comparison of row header values.
 void setRowHeaderComparer(int hdridx, Comparer comp)
          Set the row header comparer used for comparison of row header values.
 void setRowSortByValInfo(int ccol, int dcol, boolean reverse)
          Set row header sort by value info.
 void setRowTopN(int rcol, int dcol, int topn, boolean reverse, boolean others)
          Set row header topn.
 void setRowTotalOnTop(boolean top)
          Set option to set the row total area on top of the group.
 void setShowSummaryHeaders(boolean sumTitle)
          Set whether to add summary title row/column.
 void setSortInfo(inetsoft.report.internal.binding.CrosstabSortInfo sinfo)
          Set a sort info .
 void setSummarySideBySide(boolean horizontal)
          If this option is true, and there are multiple summary cells, they are arranged side by side in the table.
 void setSuppressColumnGrandTotal(boolean sup)
          Set option to set if suppress the col grand total area.
 void setSuppressColumnGroupTotal(boolean[] sup)
          Set option to set if suppress the col group total area.
 void setSuppressColumnGroupTotal(boolean sup, int i)
          Set option to set if suppress the col group total area.
 void setSuppressColumnSubtotal(boolean sup)
          Set option to set if suppress the col subtotal area.
 void setSuppressRowGrandTotal(boolean sup)
          Set option to set if suppress the row grand total area.
 void setSuppressRowGroupTotal(boolean[] sup)
          Set option to set if suppress the row group total area.
 void setSuppressRowGroupTotal(boolean sup, int i)
          Set option to set if suppress the row group total area.
 void setSuppressRowSubtotal(boolean sup)
          Set option to set if suppress the row subtotal area.
 void setTable(TableLens table)
          Set the base table to be used with the attribute table table.
 void setTopNAggregateInfo(int dcol, int n, boolean topn)
          Set the global topN.
 void setTotalLabel(String label)
          Set the label string for total columns and rows.
protected  void sort(Vector source, Comparer comp)
          Sort a vector.
 
Methods inherited from class inetsoft.report.lens.AbstractTableLens
addChangeListener, clone, containsDrill, containsFormat, findColumnByIdentifier, fireChangeEvent, getBoolean, getByte, getColType, getColumnIdentifier, getDefaultFormat, getDouble, getFloat, getInt, getLong, getShort, getXDrillInfo, isLineWrap, isNull, isPrimitive, moreRows, 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.TableLens
addChangeListener, containsDrill, containsFormat, getDefaultFormat, getXDrillInfo, isLineWrap, removeChangeListener
 
Methods inherited from interface inetsoft.uql.XTable
getBoolean, getByte, getColType, getColumnIdentifier, getDouble, getFloat, getInt, getLong, getShort, isNull, isPrimitive, moreRows, setColumnIdentifier
 

Field Detail

ROW_GRAND_TOTAL_HEADER

public static final String ROW_GRAND_TOTAL_HEADER
Row grand total header in table data path.

See Also:
Constant Field Values

COL_GRAND_TOTAL_HEADER

public static final String COL_GRAND_TOTAL_HEADER
Col grand total header in table data path.

See Also:
Constant Field Values

minfos

protected Map minfos

levels

protected Map levels
Constructor Detail

CrossTabFilter

public CrossTabFilter(TableLens table,
                      int rowh,
                      int colh,
                      int dcol,
                      Formula sum)
Create a crosstab table with the specified row, column, and data columns. An optional formula can be supplied.

Parameters:
table - base table.
rowh - row header column.
colh - column header column.
dcol - data column.
sum - formula or null.

CrossTabFilter

public CrossTabFilter(TableLens table,
                      int[] rowh,
                      int colh,
                      int dcol,
                      Formula sum)
Create a crosstab table with the specified row, column, and data columns. An optional formula can be supplied.

Parameters:
table - base table.
rowh - row header column.
colh - column header column.
dcol - data column.
sum - formula or null.

CrossTabFilter

public CrossTabFilter(TableLens table,
                      int rowh,
                      int[] colh,
                      int dcol,
                      Formula sum)
Create a crosstab table with the specified row, column, and data columns. An optional formula can be supplied.

Parameters:
table - base table.
rowh - row header column.
colh - column header column.
dcol - data column.
sum - formula or null.

CrossTabFilter

public CrossTabFilter(TableLens table,
                      int[] rowh,
                      int[] colh,
                      int dcol,
                      Formula sum)
Create a crosstab table with the specified row, column, and data columns. An optional formula can be supplied.

Parameters:
table - base table.
rowh - row header column.
colh - column header column.
dcol - data column.
sum - formula or null.

CrossTabFilter

public CrossTabFilter(TableLens table,
                      int rowh,
                      int colh,
                      int[] dcol,
                      Formula[] sum)
Create a crosstab table with the specified row, column, and data columns. An optional formula can be supplied.

Parameters:
table - base table.
rowh - row header column.
colh - column header column.
dcol - data column.
sum - formula or null.

CrossTabFilter

public CrossTabFilter(TableLens table,
                      int[] rowh,
                      int colh,
                      int[] dcol,
                      Formula[] sum)
Create a crosstab table with the specified row, column, and data columns. An optional formula can be supplied.

Parameters:
table - base table.
rowh - row header column.
colh - column header column.
dcol - data column.
sum - formula or null.

CrossTabFilter

public CrossTabFilter(TableLens table,
                      int rowh,
                      int[] colh,
                      int[] dcol,
                      Formula[] sum)
Create a crosstab table with the specified row, column, and data columns. An optional formula can be supplied.

Parameters:
table - base table.
rowh - row header column.
colh - column header column.
dcol - data column.
sum - formula or null.

CrossTabFilter

public CrossTabFilter(TableLens table,
                      int[] rowh,
                      int[] colh,
                      int[] dcol,
                      Formula[] sum)
Create a crosstab table with the specified row, column, and data columns. An optional formula can be supplied.

Parameters:
table - base table.
rowh - row header column.
colh - column header column.
dcol - data column.
sum - formula or null.
Method Detail

getRowHeaderCount

public int getRowHeaderCount()
Get the row header count.


getColHeaderCount

public int getColHeaderCount()
Get the column header count.


setTable

public void setTable(TableLens table)
Set the base table to be used with the attribute table table.

Note: override super.setTable not to cache data.

Specified by:
setTable in interface TableFilter
Parameters:
table - the base table

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.

getBaseRowIndex

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

Specified by:
getBaseRowIndex in interface TableFilter
Parameters:
row - row index in the filtered 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.

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.

getHeaderRowCount

public final 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 final 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

getDataColCount

public final int getDataColCount()
Return the number one or more data columns


getTrailerRowCount

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

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

getTrailerColCount

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

Specified by:
getTrailerColCount in interface XTable
Overrides:
getTrailerColCount 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.

getColBorder

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

Specified by:
getColBorder in interface TableLens
Overrides:
getColBorder 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.

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.

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.

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.

setGrid

public void setGrid(CrosstabGrid grid)
Set the crosstab grid type.


getGrid

public CrosstabGrid getGrid()
Get the crosstab grid type.


setPercentFormat

public void setPercentFormat(Format fmt)
Set the format used to show percentages.


getPercentFormat

public Format getPercentFormat()
Get the format used to show percentages.


setTotalLabel

public void setTotalLabel(String label)
Set the label string for total columns and rows.


getTotalLabel

public String getTotalLabel()
Get the label string for total columns and rows.


setRowHeaderComparer

public void setRowHeaderComparer(Comparer comp)
Set the row header comparer used for comparison of row header values.


setRowHeaderComparer

public void setRowHeaderComparer(int hdridx,
                                 Comparer comp)
Set the row header comparer used for comparison of row header values.


getRowComparer

public Comparer getRowComparer()
Get the comparer used for comparison of row header values.


getRowComparer

public Comparer getRowComparer(int hdridx)
Get the comparer used for comparison of row header values.


setColHeaderComparer

public void setColHeaderComparer(Comparer comp)
Set the column header comparer used for comparison of column header values.


setColHeaderComparer

public void setColHeaderComparer(int hdridx,
                                 Comparer comp)
Set the column header comparer used for comparison of column header values.


getColComparer

public Comparer getColComparer()
Get the column comparer used for comparison of column header values.


getColComparer

public Comparer getColComparer(int hdridx)
Get the comparer used for comparison of column header values.


setDataComparer

public void setDataComparer(int col,
                            Comparer comp)
Set the comparer for a data column.

Parameters:
col - the data column index in data columns, not data column index in base table
comp - the comparer

getDataComparer

public Comparer getDataComparer(int col)
Get the comparer for a data column.

Parameters:
col - the data column index in data columns, not data column index in base table
Returns:
the comparer or null if out of range

setSortInfo

public void setSortInfo(inetsoft.report.internal.binding.CrosstabSortInfo sinfo)
Set a sort info .


setRowTopN

public void setRowTopN(int rcol,
                       int dcol,
                       int topn,
                       boolean reverse,
                       boolean others)
Set row header topn.

Parameters:
rcol - the row header index in row headers, not row header's column index in base table
dcol - the data column index in data columns, not data column index in base table
topn - the topn value
reverse - true if should reverse

setColTopN

public void setColTopN(int ccol,
                       int dcol,
                       int topn,
                       boolean reverse,
                       boolean others)
Set col header topn.

Parameters:
ccol - the col header index in col headers, not col header's column index in base table
dcol - the data column index in data columns, not data column index in base table
topn - the topn value
reverse - true if should reverse

setRowSortByValInfo

public void setRowSortByValInfo(int ccol,
                                int dcol,
                                boolean reverse)
Set row header sort by value info.

Parameters:
ccol - the col header index in col headers, not col header's column index in base table
dcol - the data column index in data columns, not data column index in base table
reverse - true if should reverse

setColSortByValInfo

public void setColSortByValInfo(int ccol,
                                int dcol,
                                boolean reverse)
Set col header sort by value info.

Parameters:
ccol - the col header index in col headers, not col header's column index in base table
dcol - the data column index in data columns, not data column index in base table
reverse - true if should reverse

setTopNAggregateInfo

public void setTopNAggregateInfo(int dcol,
                                 int n,
                                 boolean topn)
Set the global topN. The topN defined through this method is applied across all cells at table level (instead of within each group).

Parameters:
dcol - the aggregate column to compare values.
n - the top N.
topn - true to get top and false to get bottom values.

removeRowTopN

public void removeRowTopN(int rcol)
Remove row header topn.

Parameters:
rcol - the row header index in row headers, not row header's column index in base table

removeColTopN

public void removeColTopN(int ccol)
Remove col header topn.

Parameters:
ccol - the col header index in col headers, not col header's column index in base table

removeRowSortByVal

public void removeRowSortByVal(int rcol)
Remove row header sort value info.

Parameters:
rcol - the row header index in row headers, not row header's column index in base table

removeColSortByVal

public void removeColSortByVal(int ccol)
Remove col header sort by value info.

Parameters:
ccol - the col header index in col headers, not col header's column index in base table

containsRowTopN

public boolean containsRowTopN(int rcol)
Test if a row header contains topn.

Parameters:
rcol - the row header index in row headers, not row header's column index in base table
Returns:
true if the specified row header contains topn, false otherwise

containsColTopN

public boolean containsColTopN(int ccol)
Test if a col header contains topn.

Parameters:
ccol - the col header index in col headers, not col header's column index in base table
Returns:
true if the specified col header contains topn, false otherwise

containsRowSortByVal

public boolean containsRowSortByVal(int rcol)
Test if a row header contains sort by value info.

Parameters:
rcol - the row header index in row headers, not row header's column index in base table
Returns:
true if the specified row header contains topn, false otherwise

containsColSortByVal

public boolean containsColSortByVal(int ccol)
Test if a col header contains sort by value info.

Parameters:
ccol - the col header index in col headers, not col header's column index in base table
Returns:
true if the specified col header contains topn, false otherwise

getTable

public TableLens getTable()
Get the base table.

Specified by:
getTable in interface TableFilter

setFillBlankWithZero

public void setFillBlankWithZero(boolean fill)
Set option to fill blank cell with zero. By default blank cells are left blank. If this is true, the blank cells are filled with zero.

Parameters:
fill - true to fill blank cell with zero.

isFillBlankWithZero

public boolean isFillBlankWithZero()
Check if column headers are kept.


setSummarySideBySide

public void setSummarySideBySide(boolean horizontal)
If this option is true, and there are multiple summary cells, they are arranged side by side in the table. Otherwise they are arranged vertically. Defaults to false.


isSummarySideBySide

public boolean isSummarySideBySide()
Check if summary cells are put side by side.


setKeepColumnHeaders

public void setKeepColumnHeaders(boolean keep)
Set option to keep column headers. By default column headers of the crosstab row header columns are not kept. If this is true, the column header of the header column (leftmost column) is the column header of the row header column in the original table.

Parameters:
keep - true to keep the column headers.

isKeepColumnHeaders

public boolean isKeepColumnHeaders()
Check if column headers are kept.


setShowSummaryHeaders

public void setShowSummaryHeaders(boolean sumTitle)
Set whether to add summary title row/column. If true, a title row is added to the header rows for summary if summary side by side is on. Otherwise, a title column is added to the header columns if summary side by side is off.


isShowSummaryHeaders

public boolean isShowSummaryHeaders()
Check whether to add summary title row/column.


setRepeatRowLabels

public void setRepeatRowLabels(boolean repeat)
Set option to repeat row labels. By default the cells for the same group is merged into a single cell. If the repeatRowLabels is set to true, the cells are still displayed individually.

Parameters:
repeat - true to repeat row label.

isRepeatRowLabels

public boolean isRepeatRowLabels()
Check if the row label are repeated.


setRowTotalOnTop

public void setRowTotalOnTop(boolean top)
Set option to set the row total area on top of the group. By default the row total area is below the group.

Parameters:
top - true to set the row total on the top.

isRowTotalOnTop

public boolean isRowTotalOnTop()
Check if the row total is on top.


setColumnTotalOnFirst

public void setColumnTotalOnFirst(boolean first)
Set option to set the col total area on first col of the group. By default the col total area is on the last col of the group.

Parameters:
first - true to set the col total on the first col.

isColumnTotalOnFirst

public boolean isColumnTotalOnFirst()
Check if the col total is on first col.


setSuppressRowGrandTotal

public void setSuppressRowGrandTotal(boolean sup)
Set option to set if suppress the row grand total area. By default the row grand total area is displayed.

Parameters:
sup - true to set suppress the row grand total area.

isSuppressRowGrandTotal

public boolean isSuppressRowGrandTotal()
Check if the row grand total is suppressed.


setSuppressColumnGrandTotal

public void setSuppressColumnGrandTotal(boolean sup)
Set option to set if suppress the col grand total area. By default the col grand total area is displayed.

Parameters:
sup - true to set suppress the col grand total area.

isSuppressColumnGrandTotal

public boolean isSuppressColumnGrandTotal()
Check if the col grand total is suppressed.


setSuppressRowSubtotal

public void setSuppressRowSubtotal(boolean sup)
Set option to set if suppress the row subtotal area. By default the row subtotal area is displayed.

Parameters:
sup - true to set suppress the row subtotal area.

isSuppressRowSubtotal

public boolean isSuppressRowSubtotal()
Check if the row subtotal is suppressed.


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.


setSuppressColumnSubtotal

public void setSuppressColumnSubtotal(boolean sup)
Set option to set if suppress the col subtotal area. By default the col subtotal area is displayed.

Parameters:
sup - true to set suppress the col subtotal area.

isSuppressColumnSubtotal

public boolean isSuppressColumnSubtotal()
Check if the col subtotal is suppressed.


setSuppressRowGroupTotal

public void setSuppressRowGroupTotal(boolean[] sup)
Set option to set if suppress the row group total area. By default the row group total area is displayed.

Parameters:
sup - true to set suppress the row group total area.

getSuppressRowGroupTotal

public boolean[] getSuppressRowGroupTotal()
Check if the row group total is suppressed.


setSuppressColumnGroupTotal

public void setSuppressColumnGroupTotal(boolean[] sup)
Set option to set if suppress the col group total area. By default the col group total area is displayed.

Parameters:
sup - true to set suppress the col group total area.

getSuppressColumnGroupTotal

public boolean[] getSuppressColumnGroupTotal()
Check if the col group total is suppressed.


setSuppressRowGroupTotal

public void setSuppressRowGroupTotal(boolean sup,
                                     int i)
Set option to set if suppress the row group total area. By default the row group total area is displayed.

Parameters:
sup - true to set suppress the row group total area.

isSuppressRowGroupTotal

public boolean isSuppressRowGroupTotal(int i)
Check if the row group total is suppressed.


setSuppressColumnGroupTotal

public void setSuppressColumnGroupTotal(boolean sup,
                                        int i)
Set option to set if suppress the col group total area. By default the col group total area is displayed.

Parameters:
sup - true to set suppress the col group total area.

isSuppressColumnGroupTotal

public boolean isSuppressColumnGroupTotal(int i)
Check if the col group total is suppressed.


setPercentageDirection

public void setPercentageDirection(int percentageDir)
Set percentage direction. only two values: StyleConstants.PERCENTAGE_BY_COL, StyleConstants.PERCENTAGE_BY_ROW. the first one is default.


getPercentageDirection

public int getPercentageDirection()
Return percentage direction.


setCondition

public void setCondition(ConditionGroup condition)
Set condition.


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

getRowColumnHeader

public Object getRowColumnHeader(int idx)
Get the row column's header.


sort

protected void sort(Vector source,
                    Comparer comp)
Sort a vector.


isHeaderCell

public boolean isHeaderCell(int row,
                            int col)
Test if the cell is a header cell.

Parameters:
row - the cell's row
col - the cell's col
Returns:
true if the cell is a header cell, false otherwise

isDataCell

public boolean isDataCell(int row,
                          int col)
Test if the cell is a data cell.

Parameters:
row - the cell's row
col - the cell's col
Returns:
true if the cell is a data cell, false otherwise

isGrandTotalCell

public boolean isGrandTotalCell(int row,
                                int col)
Test if the cell is a grandtotal cell.

Parameters:
row - the cell's row
col - the cell's col
Returns:
true if the cell is a grandtotal cell, false otherwise

getHeaderName

public String getHeaderName(int row,
                            int col)
Get a header cell's header name.

Parameters:
row - the header's row
col - the header's col
Returns:
the header cell's header name

getDataName

public String getDataName(int row,
                          int col)
Get a data cell's name.

Parameters:
row - the data cell's row
col - the data cell's col
Returns:
the data cell's name

getAvailableFields

public String[] getAvailableFields(int row,
                                   int col)
Get available fields of a crosstab cell.

Parameters:
row - the specified row
col - the specified col

getKeyValuePairs

public Map getKeyValuePairs(int row,
                            int col,
                            Map map)
Create key value paires for hyperlink and condition to use.

Parameters:
row - the specified row
col - the specified col
map - the specified map, null if should create a new one
Returns:
a map stores key value paries

getStyleCol

public int getStyleCol(int c)
Get the column to be base style.


dispose

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

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

getHeaders

public Object[] getHeaders()
Get header at an index in base table.

Returns:
header at the specified index in base table

getHeader

public Object getHeader(Object header)
Get the mapping name of the header.


setHeader

public void setHeader(Object header,
                      Object str)
Set the mapping name of specified header.


setMeasureNames

public void setMeasureNames(String[] names)
Set the measure names to table.

Specified by:
setMeasureNames in interface CalcFilter

createXMetaInfo

protected void createXMetaInfo()
Create the meta info.


getRowHeader

public String getRowHeader(int idx)
Get row header name.


getColHeader

public String getColHeader(int idx)
Get col header name.


getDataHeader

public String getDataHeader(int idx)
Get data header name.


getHeader0

protected String getHeader0(int index)
Get header content.


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