|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jasperreports.engine.fill.JRFillElement
net.sf.jasperreports.engine.fill.JRFillCrosstab
public class JRFillCrosstab
Fill-time implementation of a crosstab.
| Nested Class Summary | |
|---|---|
protected class |
JRFillCrosstab.CrosstabFiller
Crosstab filler class. |
class |
JRFillCrosstab.JRFillCrosstabDataset
Fill-time crosstab input dataset implementation. |
| Fields inherited from class net.sf.jasperreports.engine.fill.JRFillElement |
|---|
band, conditionalStylesContainer, currentEvaluation, currentStyle, defaultStyleProvider, delayedEvaluationsMap, dynamicProperties, elementGroup, expressionEvaluator, filler, initStyle, mergedProperties, originProvider, parent, printWhenGroupChanges, staticProperties, templates |
| Fields inherited from interface net.sf.jasperreports.crosstabs.JRCrosstab |
|---|
DEFAULT_COLUMN_BREAK_OFFSET, PROPERTY_IGNORE_WIDTH, 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 | |
|---|---|
JRFillCrosstab(JRBaseFiller filler,
JRCrosstab crosstab,
JRFillObjectFactory factory)
|
|
| Method Summary | |
|---|---|
void |
collectExpressions(JRExpressionCollector collector)
|
JRFillCloneable |
createClone(JRFillCloneFactory factory)
Creates a working clone of itself. |
protected JRTemplateElement |
createElementTemplate()
|
protected void |
evaluate(byte evaluation)
|
java.lang.Object |
evaluateExpression(JRExpression expression,
MeasureDefinition.MeasureValue[] measureValues)
|
protected JRPrintElement |
fill()
|
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. |
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. |
java.lang.Boolean |
getIgnoreWidth()
Returns the ignore width flag for the crosstab. |
protected JRTemplateRectangle |
getJRTemplateRectangle()
|
JRCrosstabMeasure[] |
getMeasures()
Returns the crosstab measures. |
ModeEnum |
getModeValue()
Returns the element transparency mode. |
JROrigin |
getOrigin()
Returns an element origin. |
JRCrosstabParameter[] |
getParameters()
Returns the crosstab parameters. |
JRExpression |
getParametersMapExpression()
Returns the parameters map expression. |
protected java.util.List |
getPrintElements()
|
JRCrosstabRowGroup[] |
getRowGroups()
Returns the row groups of the crosstab. |
byte |
getRunDirection()
Deprecated. Replaced by getRunDirectionValue(). |
RunDirectionEnum |
getRunDirectionValue()
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. |
protected int |
getXLimit(java.util.List printElements)
|
protected void |
initBucketingService()
|
protected void |
initEvaluator(byte evaluation)
|
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. |
protected void |
loadEvaluator(JasperReport jasperReport)
|
protected void |
mirrorPrintElements(java.util.List printElements)
|
protected boolean |
prepare(int availableHeight,
boolean isOverflow)
|
protected void |
reset()
|
protected void |
resolveElement(JRPrintElement element,
byte evaluation)
Resolves an element. |
protected void |
rewind()
|
void |
setIgnoreWidth(boolean ignoreWidth)
Set the ignore width crosstab flag. |
void |
setIgnoreWidth(java.lang.Boolean ignoreWidth)
Set the ignore width crosstab flag. |
void |
setRunDirection(byte direction)
Deprecated. Replaced by setRunDirection(RunDirectionEnum). |
void |
setRunDirection(RunDirectionEnum 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, getKey, getPositionType, getPositionTypeValue, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertyExpressions, getStretchType, getStretchTypeValue, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setPositionType, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setStretchType, setWidth, setX |
| Methods inherited from interface net.sf.jasperreports.engine.JRChild |
|---|
clone |
| Methods inherited from interface net.sf.jasperreports.engine.JRCloneable |
|---|
clone |
| Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement |
|---|
getBackcolor, getForecolor, getHeight, getMode, getOwnBackcolor, getOwnForecolor, getOwnMode, getOwnModeValue, getWidth, setBackcolor, setForecolor, setMode, setMode, setMode |
| 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 |
|---|
protected final JRCrosstab parentCrosstab
protected JRFillCrosstab.JRFillCrosstabDataset dataset
protected JRFillCrosstabRowGroup[] rowGroups
protected java.util.Map rowGroupsMap
protected JRFillCrosstabColumnGroup[] columnGroups
protected java.util.Map columnGroupsMap
protected JRFillCrosstabMeasure[] measures
protected BucketingService bucketingService
protected JRFillVariable[] variables
protected java.util.Map variablesMap
protected JRFillVariable[][][] totalVariables
protected boolean[][] retrieveTotal
protected JRFillCrosstabParameter[] parameters
protected java.util.Map parametersMap
protected boolean ignoreWidth
protected JRCrosstabExpressionEvaluator crosstabEvaluator
protected JRFillCrosstabCell[][] crossCells
protected JRFillCellContents headerCell
protected JRFillCellContents whenNoDataCell
protected boolean hasData
protected HeaderCell[][] columnHeadersData
protected HeaderCell[][] rowHeadersData
protected CrosstabCell[][] cellData
protected MeasureDefinition.MeasureValue[] grandTotals
| Constructor Detail |
|---|
public JRFillCrosstab(JRBaseFiller filler,
JRCrosstab crosstab,
JRFillObjectFactory factory)
| Method Detail |
|---|
public ModeEnum getModeValue()
JRCommonElement
getModeValue in interface JRCommonElementgetModeValue in class JRFillElementprotected void loadEvaluator(JasperReport jasperReport)
public java.lang.Object evaluateExpression(JRExpression expression,
MeasureDefinition.MeasureValue[] measureValues)
throws JRException
JRExceptionprotected void reset()
reset in class JRFillElement
protected void evaluate(byte evaluation)
throws JRException
evaluate in class JRFillElementJRException
protected void initEvaluator(byte evaluation)
throws JRException
JRExceptionprotected void initBucketingService()
protected boolean prepare(int availableHeight,
boolean isOverflow)
throws JRException
prepare in class JRFillElementJRExceptionprotected JRPrintElement fill()
fill in class JRFillElementprotected int getXLimit(java.util.List printElements)
protected JRTemplateRectangle getJRTemplateRectangle()
protected JRTemplateElement createElementTemplate()
createElementTemplate in class JRFillElementprotected void rewind()
rewind in class JRFillElementprotected java.util.List getPrintElements()
protected void mirrorPrintElements(java.util.List printElements)
protected void resolveElement(JRPrintElement element,
byte evaluation)
JRFillElement
resolveElement in class JRFillElementelement - the elementevaluation - the evaluation typepublic void collectExpressions(JRExpressionCollector collector)
collectExpressions in interface JRElementpublic void visit(JRVisitor visitor)
visit in interface JRVisitablepublic int getId()
JRCrosstabThe ID is generated when the report is compiled and is used internally.
getId in interface JRCrosstabpublic JRCrosstabDataset getDataset()
JRCrosstab
getDataset in interface JRCrosstabpublic JRCrosstabRowGroup[] getRowGroups()
JRCrosstab
getRowGroups in interface JRCrosstabpublic JRCrosstabColumnGroup[] getColumnGroups()
JRCrosstab
getColumnGroups in interface JRCrosstabpublic JRCrosstabMeasure[] getMeasures()
JRCrosstab
getMeasures in interface JRCrosstabpublic int getColumnBreakOffset()
JRCrosstabWhen 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 JRCrosstabpublic boolean isRepeatColumnHeaders()
JRCrosstab
isRepeatColumnHeaders in interface JRCrosstabpublic boolean isRepeatRowHeaders()
JRCrosstab
isRepeatRowHeaders in interface JRCrosstabpublic JRCrosstabCell[][] getCells()
JRCrosstabA 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 JRCrosstabpublic JRCellContents getWhenNoDataCell()
JRCrosstabIf 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 JRCrosstabpublic JRCrosstabParameter[] getParameters()
JRCrosstabCrosstabs 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 JRCrosstabpublic JRExpression getParametersMapExpression()
JRCrosstabThe 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 JRCrosstabpublic JRElement getElementByKey(java.lang.String elementKey)
JRCrosstab
getElementByKey in interface JRCrosstabelementKey - the element key
public JRFillCloneable createClone(JRFillCloneFactory factory)
JRFillCloneable
createClone in interface JRFillCloneablefactory - the clone factory to use while creating the clone
public JRCellContents getHeaderCell()
JRCrosstab
getHeaderCell in interface JRCrosstabpublic JRVariable[] getVariables()
JRCrosstab
getVariables in interface JRCrosstabJRCrosstabGroup.getVariable(),
JRCrosstabMeasure.getVariable(),
JRCrosstab.VARIABLE_ROW_COUNT,
JRCrosstab.VARIABLE_COLUMN_COUNTpublic byte getRunDirection()
getRunDirectionValue().
getRunDirection in interface JRCrosstabpublic void setRunDirection(byte direction)
setRunDirection(RunDirectionEnum).
setRunDirection in interface JRCrosstabpublic RunDirectionEnum getRunDirectionValue()
JRCrosstab
getRunDirectionValue in interface JRCrosstabRunDirectionEnumpublic void setRunDirection(RunDirectionEnum runDirection)
JRCrosstabCrosstabs can either be filled from left to right (the default) or from right to left (mainly for reports in RTL languages).
setRunDirection in interface JRCrosstabrunDirection - a value representing one of the run direction constants in RunDirectionEnumpublic JROrigin getOrigin()
JROriginProvider
getOrigin in interface JROriginProviderpublic java.lang.Boolean getIgnoreWidth()
JRCrosstab
getIgnoreWidth in interface JRCrosstabnull is the crosstab
does not specify a flag valueJRCrosstab.setIgnoreWidth(Boolean)public void setIgnoreWidth(java.lang.Boolean ignoreWidth)
JRCrosstabThis flag determines whether the crosstab will break at the width set for the crosstab element, or whether the crosstab is to expand over this width (and over the page width as well).
If this flag is set to true, the crosstab will expand towards
the right (or towards the left if the crosstab direction is RTL) as long
as it needs to. This would result in crosstab cells being rendered over
the page boundary; such elements will be exported by certain grid-based
exporters such as the HTML or XLS ones, but will not be visible in export
formats that observe the page width, such as the PDF exporter.
The default value of this flag is given by the
JRCrosstab.PROPERTY_IGNORE_WIDTH property.
setIgnoreWidth in interface JRCrosstabignoreWidth - whether the element width is to be ignored by the crosstab,
or null if the default setting is to be usedJRCrosstab.PROPERTY_IGNORE_WIDTHpublic void setIgnoreWidth(boolean ignoreWidth)
JRCrosstab
setIgnoreWidth in interface JRCrosstabJRCrosstab.setIgnoreWidth(Boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||