Style Intelligence v12.0

inetsoft.report
Class SummaryTableLens

java.lang.Object
  extended by inetsoft.report.lens.AbstractTableLens
      extended by inetsoft.report.lens.AttributeTableLens
          extended by inetsoft.report.SummaryTableLens
All Implemented Interfaces:
StyleConstants, TableFilter, TableLens, XConstants, XTable, Serializable, Cloneable

public abstract class SummaryTableLens
extends AttributeTableLens

This table lens allows a summary row to be added to each table segment. The getSummary() method must be implemented to calculate the summary for each column. The method is called at the end of each page to calculate the summary for the table segment on that page. This table lens must be the top-level table lens. It can not be wrapped around by a table style or any other table lens. If a table style is to be applied to a table, it must be applied to the base table of the SummaryTableLens, and NOT applied to the SummaryTableLens object.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class inetsoft.report.lens.AttributeTableLens
alignmap, attritable, backgroundmap, cache, check, colborderCmap, colbordermap, fontmap, foregroundmap, insetsmap, linkmap, presentermap, rowborderCmap, rowbordermap, table, wrapmap
 
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
SummaryTableLens()
          The setTable() method must be called before this can be used.
SummaryTableLens(TableLens table)
          Create a SummaryTableLens that add summarization information (rows) to the original table.
 
Method Summary
abstract  Object getSummary(int col, int row, int nrows)
          Calculate the summary value for the specified column and rows.
 int getSummaryAlignment(int c)
          Return the per cell alignment.
 Color getSummaryBackground(int c)
          Return the per cell background color.
 int getSummaryColBorder(int col)
          Get the summary column border style.
 Color getSummaryColBorderColor(int col)
          Get the summary column border color.
 Font getSummaryFont(int c)
          Return the per cell font.
 Color getSummaryForeground(int c)
          Return the per cell foreground color.
 int getSummaryHeight()
          Return the summary row height.
 Insets getSummaryInsets(int c)
          Return the cell gap space.
 int getSummaryRowBorder(int col)
          Get the summary row border style.
 Color getSummaryRowBorderColor(int col)
          Get the summary row border color.
 Dimension getSummarySpan(int c)
          Return the spanning setting for the cell.
 boolean isSummaryLineWrap(int c)
          Return the per cell line wrap mode.
 Object render(Object obj, int c)
          Apply appropriate format and presenter if any is register for this column.
 
Methods inherited from class inetsoft.report.lens.AttributeTableLens
clone, cloneAttributes, containsLink, dispose, findColumn, format, getAlignment, getBackground, getBaseColIndex, getBaseRowIndex, getCellFormat, getCellFormat, getColBorder, getColBorderColor, getColCount, getColHeader, getColType, getColumnIdentifier, getColWidth, getData, getDescriptor, getFont, getForeground, getFormat, getFormat, getFormat, getHeaderColCount, getHeaderRowCount, getHyperlink, getInsets, getObject, getObject0, getPresenter, getPresenter, getPresenter, getRowBorder, getRowBorderColor, getRowCount, getRowFormat, getRowHeight, getSpan, getTable, getTrailerColCount, getTrailerRowCount, invalidate, isColSuppressIfDuplicate, isColSuppressIfZero, isLineWrap, isSuppressIfDuplicate, isSuppressIfZero, moreRows, removeAllSpans, setAlignment, setAlignment, setBackground, setColAlignment, setColAutoSize, setColBackground, setColBorder, setColBorder, setColBorder, setColBorderColor, setColBorderColor, setColBorderColor, setColCount, setColFont, setColForeground, setColHeader, setColInsets, setColLineWrap, setColSuppressIfDuplicate, setColSuppressIfZero, setColWidth, setData, setFont, setFont, setForeground, setFormat, setFormat, setFormat, setHeaderColCount, setHeaderRowCount, setHyperlink, setInsets, setInsets, setLineWrap, setLineWrap, setObject, setPresenter, setPresenter, setPresenter, setRowAlignment, setRowAutoSize, setRowBackground, setRowBorder, setRowBorder, setRowBorder, setRowBorderColor, setRowBorderColor, setRowBorderColor, setRowCount, setRowFont, setRowForeground, setRowFormat, setRowHeight, setRowHeight, setRowInsets, setRowLineWrap, setRowPresenter, setSpan, setTable, setTrailerColCount, setTrailerRowCount
 
Methods inherited from class inetsoft.report.lens.AbstractTableLens
addChangeListener, containsDrill, containsFormat, findColumnByIdentifier, fireChangeEvent, getBoolean, getByte, 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.TableLens
addChangeListener, containsDrill, containsFormat, getDefaultFormat, getXDrillInfo, removeChangeListener
 
Methods inherited from interface inetsoft.uql.XTable
getBoolean, getByte, getDouble, getFloat, getInt, getLong, getShort, isNull, isPrimitive, setColumnIdentifier
 

Constructor Detail

SummaryTableLens

public SummaryTableLens()
The setTable() method must be called before this can be used.


SummaryTableLens

public SummaryTableLens(TableLens table)
Create a SummaryTableLens that add summarization information (rows) to the original table.

Parameters:
table - table to summarize.
Method Detail

getSummary

public abstract Object getSummary(int col,
                                  int row,
                                  int nrows)
Calculate the summary value for the specified column and rows. This method must be implemented to supply the actual logic to summarize a column.

Parameters:
col - column to summarize.
row - starting row number.
nrows - number of rows to summarize.
Returns:
summary value or null if no summary is defined for the column.

render

public Object render(Object obj,
                     int c)
Apply appropriate format and presenter if any is register for this column.

Parameters:
obj - object value to render.
c - column number.

getSummaryHeight

public int getSummaryHeight()
Return the summary row height. It defaults to 20.

Returns:
row height in pixels.

getSummaryRowBorderColor

public Color getSummaryRowBorderColor(int col)
Get the summary row border color. It defaults to the same value as the last row in the original table.

Parameters:
col - column number.
Returns:
row border color.

getSummaryColBorderColor

public Color getSummaryColBorderColor(int col)
Get the summary column border color. It defaults to the same value as the last row in the original table.

Parameters:
col - column number.
Returns:
col border color.

getSummaryRowBorder

public int getSummaryRowBorder(int col)
Get the summary row border style. It defaults to the same value as the last row in the original table.

Parameters:
col - column number.
Returns:
row border style.

getSummaryColBorder

public int getSummaryColBorder(int col)
Get the summary column border style. It defaults to the same value as the last row in the original table.

Parameters:
col - column number.
Returns:
column border style.

getSummaryInsets

public Insets getSummaryInsets(int c)
Return the cell gap space. It defaults to the same value as the last row in the original table.

Parameters:
c - column number.
Returns:
cell gap space.

getSummarySpan

public Dimension getSummarySpan(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. It defaults to no span.

Parameters:
c - column number.
Returns:
span cell dimension.

getSummaryAlignment

public int getSummaryAlignment(int c)
Return the per cell alignment. It defaults to the same value as the last row in the original table.

Parameters:
c - column number.
Returns:
cell alignment.

getSummaryFont

public Font getSummaryFont(int c)
Return the per cell font. Return null to use default font. It defaults to the same value as the last row in the original table.

Parameters:
c - column number.
Returns:
font for the specified cell.

isSummaryLineWrap

public boolean isSummaryLineWrap(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.

Parameters:
c - column number.
Returns:
true if line wrapping should be done.

getSummaryForeground

public Color getSummaryForeground(int c)
Return the per cell foreground color. Return null to use default color. It defaults to the same value as the last row in the original table.

Parameters:
c - column number.
Returns:
foreground color for the specified cell.

getSummaryBackground

public Color getSummaryBackground(int c)
Return the per cell background color. Return null to use default color. It defaults to the same value as the last row in the original table.

Parameters:
c - column number.
Returns:
background color for the specified cell.

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