net.sf.jasperreports.engine.fill
Class JRFillSubreport

java.lang.Object
  extended by net.sf.jasperreports.engine.fill.JRFillElement
      extended by net.sf.jasperreports.engine.fill.JRFillSubreport
All Implemented Interfaces:
JRCloneable, JRChild, JRElement, JRStyleContainer, JRSubreport

public class JRFillSubreport
extends JRFillElement
implements JRSubreport

Version:
$Id: JRFillSubreport.java 1485 2006-11-14 20:23:17 +0200 (Tue, 14 Nov 2006) teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Field Summary
protected  JRBaseFiller subreportFiller
           
 
Fields inherited from class net.sf.jasperreports.engine.fill.JRFillElement
band, conditionalStylesContainer, currentEvaluation, delayedEvaluationsMap, elementGroup, expressionEvaluator, filler, initStyle, parent, printWhenGroupChanges, templates
 
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
protected JRFillSubreport(JRBaseFiller filler, JRSubreport subreport, JRFillObjectFactory factory)
           
 
Method Summary
 void collectExpressions(JRExpressionCollector collector)
           
 JRCloneable createClone(JRFillCloneFactory factory)
          Creates a working clone of itself.
protected  JRSubreportReturnValue createDistinctCountHelperReturnValue(JRSubreportReturnValue returnValue)
           
protected  JRSubreportReturnValue createHelperReturnValue(JRSubreportReturnValue returnValue, java.lang.String nameSuffix, byte calculation)
           
protected  void evaluate(byte evaluation)
           
protected  JRPrintElement fill()
           
protected  void fillSubreport()
           
 JRExpression getConnectionExpression()
           
 JRChild getCopy(JRAbstractObjectFactory factory)
           
 JRExpression getDataSourceExpression()
           
 JRExpression getExpression()
           
protected  JRTemplateRectangle getJRTemplateRectangle()
           
 byte getMode()
          Returns the element transparency mode.
 JRSubreportParameter[] getParameters()
           
 JRExpression getParametersMapExpression()
           
static java.util.Map getParameterValues(JRBaseFiller 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  java.util.Collection getPrintElements()
           
 JRSubreportReturnValue[] getReturnValues()
          Returns the list of subreport copied values.
protected static JRSubreportRunnerFactory getRunnerFactory()
           
protected  void initSubreportFiller(JREvaluator evaluator)
           
 java.lang.Boolean isOwnUsingCache()
          Indicates if the engine is loading the current subreport from cache.
 boolean isUsingCache()
          Indicates if the engine is loading the current subreport from cache.
protected  boolean prepare(int availableStretchHeight, boolean isOverflow)
           
protected  void resolveElement(JRPrintElement element, byte evaluation)
          Resolves an element.
 void rewind()
           
 void setUsingCache(boolean isUsingCache)
          Deprecated. Replaced by setUsingCache(Boolean).
 void setUsingCache(java.lang.Boolean isUsingCache)
          Specifies if the engine should be loading the current subreport from cache.
 void writeXml(JRXmlWriter xmlWriter)
           
 
Methods inherited from class net.sf.jasperreports.engine.fill.JRFillElement
addDependantElement, collectDelayedEvaluations, collectDelayedEvaluations, delayedEvaluate, evaluateExpression, evaluatePrintWhenExpression, getBackcolor, getBand, getBandBottomY, getDefaultStyleProvider, getDependantElements, getElementGroup, getEvaluationTime, getField, getForecolor, getGroupElements, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getRelativeY, getStretchHeight, getStretchType, getStyle, getTemplate, getVariable, getWidth, getX, getY, initDelayedEvaluationPrint, initDelayedEvaluations, isAlreadyPrinted, isAutoEvaluateNow, isEvaluateAuto, isEvaluateNow, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isPrintWhenExpressionNull, isPrintWhenTrue, isRemoveLineWhenBlank, isReprinted, isToPrint, isValueRepeating, moveDependantElements, registerTemplate, reset, resolveElement, setAlreadyPrinted, setBackcolor, setBand, setBandBottomY, setConditionalStylesContainer, setCurrentEvaluation, setForecolor, setHeight, setMode, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setPrintWhenExpressionNull, setPrintWhenTrue, setRelativeY, setRemoveLineWhenBlank, setReprinted, setShrinkable, setStretchHeight, setStretchType, setToPrint, setValueRepeating, setWidth, setX, setY, stretchElement, stretchHeightFinal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jasperreports.engine.JRElement
getBackcolor, getElementGroup, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, 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.JRStyleContainer
getDefaultStyleProvider, getStyle
 

Field Detail

subreportFiller

protected JRBaseFiller subreportFiller
Constructor Detail

JRFillSubreport

protected JRFillSubreport(JRBaseFiller filler,
                          JRSubreport subreport,
                          JRFillObjectFactory factory)
Method Detail

getMode

public byte getMode()
Description copied from interface: JRElement
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 interface JRElement
Overrides:
getMode in class JRFillElement
Returns:
MODE_OPAQUE or MODE_TRANSPARENT

isUsingCache

public boolean isUsingCache()
Description copied from interface: JRSubreport
Indicates if the engine is loading the current subreport from cache. Implementations of this method rely on default values that depend on the type of the subreport expression if a value was not explicitly set of this flag.

Specified by:
isUsingCache in interface JRSubreport
Returns:
true if the subreport should be loaded from cache, false otherwise

setUsingCache

public void setUsingCache(boolean isUsingCache)
Deprecated. Replaced by setUsingCache(Boolean).

Description copied from interface: JRSubreport
Specifies if the engine should be loading the current subreport from cache. If set to true, the reporting engine will try to recognize previously loaded subreports using their specified source. For example, it will recognize a subreport if the subreport source is a file name that it has already loaded, or if it is the same URL.

For subreports that have expressions returning java.lang.String objects as the subreport source, representing file names, URLs or classpath resources, the default value for this flag is true.

Specified by:
setUsingCache in interface JRSubreport

getParametersMapExpression

public JRExpression getParametersMapExpression()
Specified by:
getParametersMapExpression in interface JRSubreport

getParameters

public JRSubreportParameter[] getParameters()
Specified by:
getParameters in interface JRSubreport

getConnectionExpression

public JRExpression getConnectionExpression()
Specified by:
getConnectionExpression in interface JRSubreport

getDataSourceExpression

public JRExpression getDataSourceExpression()
Specified by:
getDataSourceExpression in interface JRSubreport

getExpression

public JRExpression getExpression()
Specified by:
getExpression in interface JRSubreport

getJRTemplateRectangle

protected JRTemplateRectangle getJRTemplateRectangle()

getPrintElements

protected java.util.Collection getPrintElements()

evaluate

protected void evaluate(byte evaluation)
                 throws JRException
Specified by:
evaluate in class JRFillElement
Throws:
JRException

initSubreportFiller

protected void initSubreportFiller(JREvaluator evaluator)
                            throws JRException
Throws:
JRException

getParameterValues

public static java.util.Map getParameterValues(JRBaseFiller 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 filler
parametersMapExpression - expression that yields bulk parameter values map
subreportParameters - list of individual parameter values
evaluation - evaluation type
ignoreNullExpressions - whether to ignore individual parameter value expressions
removeResourceBundle - whether to remove the REPORT_RESOURCE_BUNDLE value from the bulk values map
Returns:
the parameter values map
Throws:
JRException

fillSubreport

protected void fillSubreport()
                      throws JRException
Throws:
JRException

prepare

protected boolean prepare(int availableStretchHeight,
                          boolean isOverflow)
                   throws JRException
Overrides:
prepare in class JRFillElement
Throws:
JRException

rewind

public void rewind()
            throws JRException
Specified by:
rewind in class JRFillElement
Throws:
JRException

fill

protected JRPrintElement fill()
Specified by:
fill in class JRFillElement

getCopy

public JRChild getCopy(JRAbstractObjectFactory factory)
Specified by:
getCopy in interface JRChild

collectExpressions

public void collectExpressions(JRExpressionCollector collector)
Specified by:
collectExpressions in interface JRElement

writeXml

public void writeXml(JRXmlWriter xmlWriter)
              throws java.io.IOException
Specified by:
writeXml in interface JRChild
Throws:
java.io.IOException

createHelperReturnValue

protected JRSubreportReturnValue createHelperReturnValue(JRSubreportReturnValue returnValue,
                                                         java.lang.String nameSuffix,
                                                         byte calculation)

createDistinctCountHelperReturnValue

protected JRSubreportReturnValue createDistinctCountHelperReturnValue(JRSubreportReturnValue returnValue)

getReturnValues

public JRSubreportReturnValue[] getReturnValues()
Description copied from interface: JRSubreport
Returns the list of subreport copied values.

Specified by:
getReturnValues in interface JRSubreport
Returns:
the list of subreport copied values.

resolveElement

protected void resolveElement(JRPrintElement element,
                              byte evaluation)
Description copied from class: JRFillElement
Resolves an element.

Specified by:
resolveElement in class JRFillElement
Parameters:
element - the element
evaluation - the evaluation type

isOwnUsingCache

public java.lang.Boolean isOwnUsingCache()
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:
isOwnUsingCache in interface JRSubreport
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

public void setUsingCache(java.lang.Boolean isUsingCache)
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 interface JRSubreport

createClone

public JRCloneable createClone(JRFillCloneFactory factory)
Description copied from interface: JRCloneable
Creates a working clone of itself.

Specified by:
createClone in interface JRCloneable
Parameters:
factory - the clone factory to use while creating the clone
Returns:
a working clone of itself

getRunnerFactory

protected static JRSubreportRunnerFactory getRunnerFactory()
                                                    throws JRException
Throws:
JRException


© 2001-2006 JasperSoft Corporation www.jaspersoft.com