|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jasperreports.engine.base.JRBaseElement
net.sf.jasperreports.crosstabs.base.JRBaseCrosstab
public class JRBaseCrosstab
Base read-only crosstab
implementation.
Field Summary | |
---|---|
protected JRCrosstabCell[][] |
cells
|
protected int |
columnBreakOffset
|
protected JRCrosstabColumnGroup[] |
columnGroups
|
protected JRCrosstabDataset |
dataset
|
protected JRCellContents |
headerCell
|
protected int |
id
|
protected JRCrosstabMeasure[] |
measures
|
protected JRCrosstabParameter[] |
parameters
|
protected JRExpression |
parametersMapExpression
|
static java.lang.String |
PROPERTY_RUN_DIRECTION
|
protected boolean |
repeatColumnHeaders
|
protected boolean |
repeatRowHeaders
|
protected JRCrosstabRowGroup[] |
rowGroups
|
protected byte |
runDirection
|
protected JRVariable[] |
variables
|
protected JRCellContents |
whenNoDataCell
|
Fields inherited from interface net.sf.jasperreports.crosstabs.JRCrosstab |
---|
DEFAULT_COLUMN_BREAK_OFFSET, RUN_DIRECTION_LTR, RUN_DIRECTION_RTL, VARIABLE_COLUMN_COUNT, VARIABLE_ROW_COUNT |
Fields inherited from interface net.sf.jasperreports.engine.JRElement |
---|
MODE_OPAQUE, MODE_TRANSPARENT, POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM, POSITION_TYPE_FIX_RELATIVE_TO_TOP, POSITION_TYPE_FLOAT, STRETCH_TYPE_NO_STRETCH, STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT, STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT |
Constructor Summary | |
---|---|
JRBaseCrosstab(JRCrosstab crosstab,
JRBaseObjectFactory factory,
int id)
|
Method Summary | |
---|---|
java.lang.Object |
clone()
|
void |
collectExpressions(JRExpressionCollector collector)
|
JRCrosstabCell[][] |
getCells()
Returns the data cell matrix. |
int |
getColumnBreakOffset()
Returns the column break offset. |
JRCrosstabColumnGroup[] |
getColumnGroups()
Returns the column groups of the crosstab. |
JRCrosstabDataset |
getDataset()
Returns the input dataset of the crosstab. |
static JRElement |
getElementByKey(JRCrosstab crosstab,
java.lang.String key)
|
JRElement |
getElementByKey(java.lang.String elementKey)
Searches for an element inside all crosstab cells. |
JRCellContents |
getHeaderCell()
Returns a cell which will be rendered at the upper-left corner of the crosstab. |
int |
getId()
Returns the ID of the crosstab. |
JRCrosstabMeasure[] |
getMeasures()
Returns the crosstab measures. |
byte |
getMode()
Returns the element transparency mode. |
JRCrosstabParameter[] |
getParameters()
Returns the crosstab parameters. |
JRExpression |
getParametersMapExpression()
Returns the parameters map expression. |
JRCrosstabRowGroup[] |
getRowGroups()
Returns the row groups of the crosstab. |
byte |
getRunDirection()
Retrieves the run direction of this crosstab. |
JRVariable[] |
getVariables()
Returns the variables defined for the crosstab. |
JRCellContents |
getWhenNoDataCell()
Returns a cell which will be rendered when no data was fed to the crosstab. |
boolean |
isRepeatColumnHeaders()
Returns whether to repeat the column headers after a row break. |
boolean |
isRepeatRowHeaders()
Returns whether to repeat the row headers after a column break. |
void |
setRunDirection(byte runDirection)
Sets the run direction of the crosstab. |
void |
visit(JRVisitor visitor)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.jasperreports.engine.JRElement |
---|
getElementGroup, getHeight, getKey, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getStretchType, getWidth, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX |
Methods inherited from interface net.sf.jasperreports.engine.JRChild |
---|
clone |
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement |
---|
getBackcolor, getForecolor, getOwnBackcolor, getOwnForecolor, getOwnMode |
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer |
---|
getDefaultStyleProvider, getStyle, getStyleNameReference |
Methods inherited from interface net.sf.jasperreports.engine.JRPropertiesHolder |
---|
getParentProperties, getPropertiesMap, hasProperties |
Field Detail |
---|
public static final java.lang.String PROPERTY_RUN_DIRECTION
protected int id
protected JRCrosstabParameter[] parameters
protected JRVariable[] variables
protected JRExpression parametersMapExpression
protected JRCrosstabDataset dataset
protected JRCrosstabRowGroup[] rowGroups
protected JRCrosstabColumnGroup[] columnGroups
protected JRCrosstabMeasure[] measures
protected int columnBreakOffset
protected boolean repeatColumnHeaders
protected boolean repeatRowHeaders
protected byte runDirection
protected JRCrosstabCell[][] cells
protected JRCellContents whenNoDataCell
protected JRCellContents headerCell
Constructor Detail |
---|
public JRBaseCrosstab(JRCrosstab crosstab, JRBaseObjectFactory factory, int id)
Method Detail |
---|
public byte getMode()
JRCommonElement
getMode
in interface JRCommonElement
getMode
in class JRBaseElement
public int getId()
JRCrosstab
The ID is generated when the report is compiled and is used internally.
getId
in interface JRCrosstab
public JRCrosstabDataset getDataset()
JRCrosstab
getDataset
in interface JRCrosstab
public JRCrosstabRowGroup[] getRowGroups()
JRCrosstab
getRowGroups
in interface JRCrosstab
public JRCrosstabColumnGroup[] getColumnGroups()
JRCrosstab
getColumnGroups
in interface JRCrosstab
public JRCrosstabMeasure[] getMeasures()
JRCrosstab
getMeasures
in interface JRCrosstab
public void collectExpressions(JRExpressionCollector collector)
collectExpressions
in interface JRElement
public void visit(JRVisitor visitor)
visit
in interface JRVisitable
public int getColumnBreakOffset()
JRCrosstab
When the crosstab columns do not fit the width, the crosstab breaks the columns and prints the ones that don't fit after printing the first set of columns for all rows. This method returns the offset to be used when continuing the printing after a column break.
getColumnBreakOffset
in interface JRCrosstab
public boolean isRepeatColumnHeaders()
JRCrosstab
isRepeatColumnHeaders
in interface JRCrosstab
public boolean isRepeatRowHeaders()
JRCrosstab
isRepeatRowHeaders
in interface JRCrosstab
public JRCrosstabCell[][] getCells()
JRCrosstab
A crosstab can have multiple data cells for row/groups totals. These cells are organized in a (rowGroupCount + 1) x (columnGroupCount + 1) matrix as following:
E.g. if the crosstab has Country and City (subgroup of Country) row groups and Year and Month column groups, the cells will be organized in the following matrix
0/Years total | 1/Months total | 2/Base | |
0/Countries total | Total for all countries and all years | Total for all countries and a year | Total for all countries and a month |
1/Cities total | Total for a country and all years | Total for a country and a year | Total for a country and a month |
2/Base | Total for a city and all years | Total for a city and a year | Total for a city and a month |
If the data cell for a total row/column is not specified, the cell will be inherited from lower levels, if possible. For example, if the "Total for all countries and a year" cell is not specified, the "Total for a country and a year" or "Total for a city and a year" cell will be used (in this order).
The data cell sizes are calculated from the base data cell sizes, i.e. the height of all data cells for a row will be the height of the base cell of that row. The base cell sizes are also inherited, e.g. if the height of a total row is not specified the height of the base row will be used.
getCells
in interface JRCrosstab
public JRCrosstabParameter[] getParameters()
JRCrosstab
Crosstabs have separate expression evaluators and cannot access the parameters/fields/variables of the report. In order to use a value from the report inside a crosstab, it should be passed as parameter to the crosstab.
A crosstab parameters has a name and a value expression.
getParameters
in interface JRCrosstab
public JRExpression getParametersMapExpression()
JRCrosstab
The set of values for crosstab parameters can be set using a map. If a parameter has also a value expression, it will overwrite the value from the map.
getParametersMapExpression
in interface JRCrosstab
public JRCellContents getWhenNoDataCell()
JRCrosstab
If this cell is not specified for a crosstab, nothing will be rendered for an empty crosstab.
The cell sizes are the same as the crosstab element sizes.
getWhenNoDataCell
in interface JRCrosstab
public static JRElement getElementByKey(JRCrosstab crosstab, java.lang.String key)
public JRElement getElementByKey(java.lang.String elementKey)
JRCrosstab
getElementByKey
in interface JRCrosstab
elementKey
- the element key
public JRCellContents getHeaderCell()
JRCrosstab
getHeaderCell
in interface JRCrosstab
public JRVariable[] getVariables()
JRCrosstab
getVariables
in interface JRCrosstab
JRCrosstabGroup.getVariable()
,
JRCrosstabMeasure.getVariable()
,
JRCrosstab.VARIABLE_ROW_COUNT
,
JRCrosstab.VARIABLE_COLUMN_COUNT
public byte getRunDirection()
JRCrosstab
getRunDirection
in interface JRCrosstab
JRCrosstab.setRunDirection(byte)
public void setRunDirection(byte runDirection)
JRCrosstab
Crosstabs can either be filled from left to right (the default) or from right to left (mainly for reports in RTL languages).
setRunDirection
in interface JRCrosstab
runDirection
- one of RUN_DIRECTION_LTR
and RUN_DIRECTION_RTL
public java.lang.Object clone()
clone
in interface JRCloneable
clone
in class JRBaseElement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |