Package net.sf.jasperreports.engine.fill
Class JRFillSubreport
java.lang.Object
net.sf.jasperreports.engine.fill.JRFillElement
net.sf.jasperreports.engine.fill.JRFillSubreport
- All Implemented Interfaces:
Cloneable
,DynamicPropertiesHolder
,JRFillCloneable
,JRChild
,JRCloneable
,JRCommonElement
,JRElement
,JRIdentifiable
,JRPropertiesHolder
,JRStyleContainer
,JRStyleSetter
,JRSubreport
,JRVisitable
- Direct Known Subclasses:
ComponentFillSubreport
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
protected JRPrintPage
static final String
Property used to specify when rectangle elements should be generated for subreports during the report filling.protected FillerSubreportParent
static final String
protected JRBaseFiller
Fields inherited from class net.sf.jasperreports.engine.fill.JRFillElement
band, conditionalStylesContainer, currentEvaluation, currentStyle, defaultPopulateTemplateStyle, defaultStyleProvider, delayedEvaluationsMap, dynamicProperties, dynamicTransferProperties, elementGroup, EXCEPTION_MESSAGE_KEY_INVALID_BOOKMARK_LEVEL, expressionEvaluator, exprStyle, fillContainerContext, filler, hasDynamicPopulateTemplateStyle, initStyle, mergedProperties, originProvider, parent, printElementOriginator, printWhenGroupChanges, propertyExpressions, providerStyle, staticProperties, staticTransferProperties, styleProviders, templates
Fields inherited from interface net.sf.jasperreports.engine.JRElement
PROPERTY_ELEMENT_TEMPLATE_POPULATE_STYLE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
JRFillSubreport
(JRBaseFiller filler, JRSubreport subreport, JRFillObjectFactory factory) protected
JRFillSubreport
(JRFillSubreport subreport, JRFillCloneFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
collectExpressions
(JRExpressionCollector collector) createClone
(JRFillCloneFactory factory) Creates a working clone of itself.protected JRTemplateElement
protected DatasetExpressionEvaluator
protected FillerSubreportParent
createFillerParent
(DatasetExpressionEvaluator evaluator) protected void
evaluate
(byte evaluation) evaluateParameterValues
(byte evaluation) protected JasperReportSource
evaluateReportSource
(byte evaluation) protected void
evaluateSubreport
(byte evaluation) protected void
protected JRPrintElement
fill()
protected void
protected String
protected int
protected JRTemplateRectangle
getMode()
Returns the element transparency mode.getParameterValues
(BaseReportFiller filler, JRFillExpressionEvaluator expressionEvaluator, JRExpression parametersMapExpression, JRDatasetParameter[] subreportParameters, byte evaluation, boolean ignoreNullExpressions, boolean removeResourceBundle, boolean removeFormatFactory) Utility method used for constructing a parameter values map for subreports, sub datasets and crosstabs.getParameterValues
(BaseReportFiller filler, JRExpression parametersMapExpression, JRDatasetParameter[] subreportParameters, byte evaluation, boolean ignoreNullExpressions, boolean removeResourceBundle, boolean removeFormatFactory) Utility method used for constructing a parameter values map for subreports, sub datasets and crosstabs.protected int
protected Collection
<JRPrintElement> protected JasperReport
protected String
protected String
static JasperReportSource
getReportSource
(Object source, Boolean isUsingCache, BaseReportFiller filler) Returns the list of subreport copied values.protected JRSubreportRunnerFactory
Indicates if the engine is loading the current subreport from cache.protected void
initSubreportFiller
(DatasetExpressionEvaluator evaluator) protected boolean
Specifies whether the subreport element will consume the entire vertical space available on the report page.protected boolean
isSplitTypePreventInhibited
(boolean isTopLevelCall) static JasperReport
loadReport
(Object source, BaseReportFiller filler) protected DatasetExpressionEvaluator
protected static JasperReportSource
loadReportSource
(Object reportSource, String contextLocation, BaseReportFiller filler) protected boolean
prepare
(int availableHeight, boolean isOverflow, boolean isOverflowAllowed) protected void
registerReportStyles
(List<JRStyle> styles) protected void
resolveElement
(JRPrintElement element, byte evaluation) Resolves an element.void
rewind()
protected void
setBand
(JRFillBand band) void
setOverflowType
(OverflowType overflowType) void
setRunToBottom
(Boolean runToBottom) Sets the flag that Specifies whether the subreport element will consume the entire vertical space available on the report page.void
setUsingCache
(Boolean isUsingCache) Specifies if the engine should be loading the current subreport from cache.void
boolean
protected void
protected void
void
Methods inherited from class net.sf.jasperreports.engine.fill.JRFillElement
addDependantElement, addDynamicProperty, clone, clone, clone, collectDelayedEvaluations, collectDelayedEvaluations, collectDelayedEvaluations, collectStyleDelayedEvaluations, collectStyleProviderDelayedEvaluations, delayedEvaluate, delayedEvaluationUpdatesTemplate, evaluateExpression, evaluatePrintWhenExpression, evaluateProperties, evaluateStyle, getBackcolor, getBand, getBookmarkLevel, getCollapsedHeightAbove, getCollapsedHeightBelow, getConditionalStylesContainer, getDefaultStyleProvider, getDependantElements, getDynamicProperties, getElementGroup, getElementOrigin, getElementTemplate, getEvaluatedProperties, getEvaluationTime, getField, getFiller, getForecolor, getGroupElements, getHeight, getInitStyle, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, getParent, getParentProperties, getPositionType, getPrepareHeight, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertiesMap, getPropertyExpressions, getRelativeY, getStretchHeight, getStretchType, getStyle, getStyleExpression, getStyleNameReference, getStyleResolver, getTemplate, getTimeZone, getUUID, getVariable, getWidth, getX, getY, hasDynamicProperties, hasDynamicProperty, hasProperties, initDelayedEvaluationPrint, initDelayedEvaluations, initStyleProviders, isAlreadyPrinted, isAutoEvaluateNow, isDelayedStyleEvaluation, isEvaluateAuto, isEvaluateNow, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isPrintWhenExpressionNull, isPrintWhenTrue, isRemoveLineWhenBlank, isReprinted, isToPrint, isValueRepeating, moveDependantElements, performDelayedEvaluation, registerTemplate, reset, resolveElement, setAlreadyPrinted, setBackcolor, setCollapsedHeightAbove, setCollapsedHeightBelow, setConditionalStylesContainer, setCurrentEvaluation, setExpressionEvaluator, setForecolor, setHeight, setMode, setOriginProvider, setPositionType, setPrepareHeight, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setPrintWhenExpressionNull, setPrintWhenTrue, setRelativeY, setRemoveLineWhenBlank, setReprinted, setShrinkable, setStretchHeight, setStretchType, setStyle, setStyleNameReference, setToPrint, setValueRepeating, setWidth, setX, setY, stretchElement, stretchElementToContainer, stretchElementToElementGroup, stretchElementToHeight, toPopulateTemplateStyle, transferProperties, transferProperties
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.JRCloneable
clone
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, getWidth, setBackcolor, setForecolor, setMode
Methods inherited from interface net.sf.jasperreports.engine.JRElement
clone, getElementGroup, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertyExpressions, getStretchType, getStyleExpression, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
Methods inherited from interface net.sf.jasperreports.engine.JRIdentifiable
getUUID
Methods inherited from interface net.sf.jasperreports.engine.JRPropertiesHolder
getParentProperties, getPropertiesMap, hasProperties
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getDefaultStyleProvider, getStyle, getStyleName, getStyleNameReference
-
Field Details
-
EXCEPTION_MESSAGE_KEY_PROPERTY_NOT_SET
- See Also:
-
EXCEPTION_MESSAGE_KEY_NO_REWINDABLE_DATA_SOURCE
- See Also:
-
EXCEPTION_MESSAGE_KEY_UNSUPPORTED_SECTION_TYPE
- See Also:
-
EXCEPTION_MESSAGE_KEY_UNKNOWN_SOURCE_CLASS
- See Also:
-
PROPERTY_SUBREPORT_GENERATE_RECTANGLE
Property used to specify when rectangle elements should be generated for subreports during the report filling. If the property value isalways
, rectangle elements will be always generated, otherwise they will be created only if the subreport element is not transparent or it has properties- See Also:
-
SUBREPORT_GENERATE_RECTANGLE_ALWAYS
- See Also:
-
subreportFiller
-
subFillerParent
-
printPage
-
-
Constructor Details
-
JRFillSubreport
-
JRFillSubreport
-
-
Method Details
-
setBand
- Overrides:
setBand
in classJRFillElement
-
getMode
Description copied from interface:JRCommonElement
Returns the element transparency mode. The default value depends on the type of the report element. Graphic elements like rectangles and lines are opaque by default, but the images are transparent. Both static texts and text fields are transparent by default, and so are the subreport elements.- Specified by:
getMode
in interfaceJRCommonElement
- Overrides:
getMode
in classJRFillElement
-
usingCache
public boolean usingCache() -
isRunToBottom
Description copied from interface:JRSubreport
Specifies whether the subreport element will consume the entire vertical space available on the report page.- Specified by:
isRunToBottom
in interfaceJRSubreport
- Returns:
- whether the subreport element will consume the entire space down to the bottom of the page
- See Also:
-
setRunToBottom
Description copied from interface:JRSubreport
Sets the flag that Specifies whether the subreport element will consume the entire vertical space available on the report page.This flag should be set to
true
if the subreport needs to always print its column and page footers at the bottom of the report page, even when the subreport data does not stretch to the bottom.Note that when
isFloatColumnFooter
is set for the subreport, the column footers will not be printed at the bottom of the page even if this flag is set.- Specified by:
setRunToBottom
in interfaceJRSubreport
- Parameters:
runToBottom
- whether the subreport element will consume the entire space down to the bottom of the page
-
getOverflowType
- Specified by:
getOverflowType
in interfaceJRSubreport
-
setOverflowType
- Specified by:
setOverflowType
in interfaceJRSubreport
-
getParametersMapExpression
- Specified by:
getParametersMapExpression
in interfaceJRSubreport
-
getParameters
- Specified by:
getParameters
in interfaceJRSubreport
-
getConnectionExpression
- Specified by:
getConnectionExpression
in interfaceJRSubreport
-
getDataSourceExpression
- Specified by:
getDataSourceExpression
in interfaceJRSubreport
-
getExpression
- Specified by:
getExpression
in interfaceJRSubreport
-
getJRTemplateRectangle
-
createElementTemplate
- Specified by:
createElementTemplate
in classJRFillElement
-
getPrintElements
-
getPrintContentsWidth
protected int getPrintContentsWidth() -
subreportPageFilled
public void subreportPageFilled() -
evaluate
- Specified by:
evaluate
in classJRFillElement
- Throws:
JRException
-
evaluateReportSource
- Throws:
JRException
-
getReportSource
public static JasperReportSource getReportSource(Object source, Boolean isUsingCache, BaseReportFiller filler) throws JRException - Throws:
JRException
-
loadReportSource
protected static JasperReportSource loadReportSource(Object reportSource, String contextLocation, BaseReportFiller filler) throws JRException - Throws:
JRException
-
loadReport
- Throws:
JRException
-
evaluateSubreport
- Throws:
JRException
-
getReport
-
evaluateParameterValues
- Throws:
JRException
-
loadReportEvaluator
- Throws:
JRException
-
evictReportEvaluator
protected void evictReportEvaluator() -
createEvaluator
- Throws:
JRException
-
isReorderBandElements
protected boolean isReorderBandElements() -
initSubreportFiller
- Throws:
JRException
-
createFillerParent
protected FillerSubreportParent createFillerParent(DatasetExpressionEvaluator evaluator) throws JRException - Throws:
JRException
-
getParameterValues
public static Map<String,Object> getParameterValues(BaseReportFiller filler, JRExpression parametersMapExpression, JRDatasetParameter[] subreportParameters, byte evaluation, boolean ignoreNullExpressions, boolean removeResourceBundle, boolean removeFormatFactory) throws JRException Utility method used for constructing a parameter values map for subreports, sub datasets and crosstabs.- Parameters:
filler
- report fillerparametersMapExpression
- expression that yields bulk parameter values mapsubreportParameters
- list of individual parameter valuesevaluation
- evaluation typeignoreNullExpressions
- whether to ignore individual parameter value expressionsremoveResourceBundle
- whether to remove theREPORT_RESOURCE_BUNDLE
value from the bulk values map- Returns:
- the parameter values map
- Throws:
JRException
-
getParameterValues
public static Map<String,Object> getParameterValues(BaseReportFiller filler, JRFillExpressionEvaluator expressionEvaluator, JRExpression parametersMapExpression, JRDatasetParameter[] subreportParameters, byte evaluation, boolean ignoreNullExpressions, boolean removeResourceBundle, boolean removeFormatFactory) throws JRException Utility method used for constructing a parameter values map for subreports, sub datasets and crosstabs.- Parameters:
filler
- report fillerexpressionEvaluator
- expression evaluatorparametersMapExpression
- expression that yields bulk parameter values mapsubreportParameters
- list of individual parameter valuesevaluation
- evaluation typeignoreNullExpressions
- whether to ignore individual parameter value expressionsremoveResourceBundle
- whether to remove theREPORT_RESOURCE_BUNDLE
value from the bulk values map- Returns:
- the parameter values map
- Throws:
JRException
-
fillSubreport
- Throws:
JRException
-
prepare
protected boolean prepare(int availableHeight, boolean isOverflow, boolean isOverflowAllowed) throws JRException - Overrides:
prepare
in classJRFillElement
- Throws:
JRException
-
rewind
- Specified by:
rewind
in classJRFillElement
- Throws:
JRException
-
cancelSubreportFill
- Throws:
JRException
-
fill
- Specified by:
fill
in classJRFillElement
-
generateRectangleOption
-
collectExpressions
- Specified by:
collectExpressions
in interfaceJRElement
-
visit
- Specified by:
visit
in interfaceJRVisitable
-
getReturnValues
Description copied from interface:JRSubreport
Returns the list of subreport copied values.- Specified by:
getReturnValues
in interfaceJRSubreport
- Returns:
- the list of subreport copied values.
-
validateReport
- Throws:
JRException
-
verifyBandHeights
- Throws:
JRException
-
resolveElement
Description copied from class:JRFillElement
Resolves an element.- Specified by:
resolveElement
in classJRFillElement
- Parameters:
element
- the elementevaluation
- the evaluation type
-
getUsingCache
Description copied from interface:JRSubreport
Indicates if the engine is loading the current subreport from cache. Implementations of this method return the actual value for the internal flag that was explicitly set on this subreport.- Specified by:
getUsingCache
in interfaceJRSubreport
- Returns:
- Boolean.TRUE if the subreport should be loaded from cache, Boolean.FALSE otherwise or null in case the flag was never explicitly set on this subreport element
-
setUsingCache
Description copied from interface:JRSubreport
Specifies if the engine should be loading the current subreport from cache. If set to Boolean.TRUE, the reporting engine will try to recognize previously loaded subreports using their specified source. For example, it will recognize an subreport if the subreport source is a file name that it has already loaded, or if it is the same URL.If set to null, the engine will rely on some default value which depends on the type of the subreport expression. The cache is turned on by default only for subreports that have java.lang.String objects in their expressions.
- Specified by:
setUsingCache
in interfaceJRSubreport
-
createClone
Description copied from interface:JRFillCloneable
Creates a working clone of itself.- Specified by:
createClone
in interfaceJRFillCloneable
- Parameters:
factory
- the clone factory to use while creating the clone- Returns:
- a working clone of itself
-
getRunnerFactory
- Throws:
JRException
-
getContentsStretchHeight
protected int getContentsStretchHeight() -
getReportLocation
-
registerReportStyles
-
getReportName
-
isSplitTypePreventInhibited
protected boolean isSplitTypePreventInhibited(boolean isTopLevelCall)
-