net.sf.jasperreports.engine.design

## Class JRDesignSubreport

- java.lang.Object
- - net.sf.jasperreports.engine.base.JRBaseElement
  - - net.sf.jasperreports.engine.design.JRDesignElement
    - - net.sf.jasperreports.engine.design.JRDesignSubreport

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, JRChangeEventsSupport, JRChild, JRCloneable, JRCommonElement, JRElement, JRIdentifiable, JRPropertiesHolder, JRStyleContainer, JRSubreport, JRVisitable

      public class JRDesignSubreport
      extends JRDesignElement
      implements JRSubreport

  Version:
    $Id: JRDesignSubreport.java 7070 2014-04-30 14:46:08Z lucianc $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected JRExpression` | `connectionExpression`
    `protected JRExpression` | `dataSourceExpression`
    `protected JRExpression` | `expression`
    `protected java.lang.Boolean` | `isUsingCache`
    `protected java.util.Map<java.lang.String,JRSubreportParameter>` | `parametersMap`
    `protected JRExpression` | `parametersMapExpression`
    `static java.lang.String` | `PROPERTY_CONNECTION_EXPRESSION`
    `static java.lang.String` | `PROPERTY_DATASOURCE_EXPRESSION`
    `static java.lang.String` | `PROPERTY_EXPRESSION`
    `static java.lang.String` | `PROPERTY_PARAMETERS`
    `static java.lang.String` | `PROPERTY_PARAMETERS_MAP_EXPRESSION`
    `static java.lang.String` | `PROPERTY_RETURN_VALUES`
    `protected java.util.List<JRSubreportReturnValue>` | `returnValues` Values to be copied from the subreport into the master report.

    - ### Fields inherited from class net.sf.jasperreports.engine.design.JRDesignElement

      `PROPERTY_ELEMENT_GROUP, PROPERTY_HEIGHT, PROPERTY_KEY, PROPERTY_PARENT_STYLE, PROPERTY_PARENT_STYLE_NAME_REFERENCE, PROPERTY_PRINT_WHEN_EXPRESSION, PROPERTY_PRINT_WHEN_GROUP_CHANGES, PROPERTY_PROPERTY_EXPRESSIONS, PROPERTY_Y`

    - ### Fields inherited from class net.sf.jasperreports.engine.base.JRBaseElement

      `backcolor, defaultStyleProvider, elementGroup, forecolor, height, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, key, modeValue, parentStyle, parentStyleNameReference, positionTypeValue, printWhenExpression, printWhenGroupChanges, PROPERTY_POSITION_TYPE, PROPERTY_PRINT_IN_FIRST_WHOLE_BAND, PROPERTY_PRINT_REPEATED_VALUES, PROPERTY_PRINT_WHEN_DETAIL_OVERFLOWS, PROPERTY_REMOVE_LINE_WHEN_BLANK, PROPERTY_STRETCH_TYPE, PROPERTY_WIDTH, PROPERTY_X, stretchTypeValue, uuid, width, x, y`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JRDesignSubreport(JRDefaultStyleProvider defaultStyleProvider)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addParameter(JRSubreportParameter subreportParameter)`
    `void` | `addReturnValue(JRSubreportReturnValue returnValue)` Adds a return value to the subreport.
    `java.lang.Object` | `clone()`
    `void` | `collectExpressions(JRExpressionCollector collector)`
    `JRExpression` | `getConnectionExpression()`
    `JRExpression` | `getDataSourceExpression()`
    `JRExpression` | `getExpression()`
    `ModeEnum` | `getModeValue()` Returns the element transparency mode.
    `OverflowType` | `getOverflowType()`
    `JRSubreportParameter[]` | `getParameters()`
    `java.util.Map<java.lang.String,JRSubreportParameter>` | `getParametersMap()`
    `JRExpression` | `getParametersMapExpression()`
    `JRSubreportReturnValue[]` | `getReturnValues()` Returns the list of values to be copied from the subreport into the master.
    `java.util.List<JRSubreportReturnValue>` | `getReturnValuesList()` Returns the list of values to be copied from the subreport into the master.
    `java.lang.Boolean` | `getUsingCache()` Indicates if the engine is loading the current subreport from cache.
    `java.lang.Boolean` | `isOwnUsingCache()` Deprecated. Replaced by `getUsingCache()`.
    `java.lang.Boolean` | `isRunToBottom()` Specifies whether the subreport element will consume the entire vertical space available on the report page.
    `boolean` | `isUsingCache()` Deprecated. Replaced by `getUsingCache()`.
    `JRSubreportParameter` | `removeParameter(java.lang.String name)`
    `boolean` | `removeReturnValue(JRSubreportReturnValue returnValue)` Removes a return value from the subreport.
    `void` | `setConnectionExpression(JRExpression connectionExpression)`
    `void` | `setDataSourceExpression(JRExpression dataSourceExpression)`
    `void` | `setExpression(JRExpression expression)`
    `void` | `setOverflowType(OverflowType overflowType)`
    `void` | `setParametersMapExpression(JRExpression parametersMapExpression)`
    `void` | `setRunToBottom(java.lang.Boolean runToBottom)` Sets the flag that Specifies whether the subreport element will consume the entire vertical space available on the report page.
    `void` | `setUsingCache(java.lang.Boolean isUsingCache)` Specifies if the engine should be loading the current subreport from cache.
    `void` | `visit(JRVisitor visitor)`

    - ### Methods inherited from class net.sf.jasperreports.engine.design.JRDesignElement

      `addPropertyExpression, getPropertyExpressions, getPropertyExpressionsList, removePropertyExpression, removePropertyExpression, setElementGroup, setHeight, setKey, setPrintWhenExpression, setPrintWhenGroupChanges, setStyle, setStyleNameReference, setUUID, setY`

    - ### Methods inherited from class net.sf.jasperreports.engine.base.JRBaseElement

      `clone, clone, getBackcolor, getBaseStyle, getDefaultStyleProvider, getElementGroup, getEventSupport, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getParentProperties, getPositionTypeValue, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertiesMap, getStretchTypeValue, getStyle, getStyleNameReference, getUUID, getWidth, getX, getY, hasProperties, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX`

    - ### 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

      `clone, getElementGroup, getKey, getPositionTypeValue, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertyExpressions, getStretchTypeValue, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, 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, getHeight, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getWidth, setBackcolor, setForecolor, 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`

    - ### Methods inherited from interface net.sf.jasperreports.engine.JRIdentifiable

      `getUUID`

- - ### Field Detail

    - #### PROPERTY_CONNECTION_EXPRESSION

          public static final java.lang.String PROPERTY_CONNECTION_EXPRESSION

      See Also:
        Constant Field Values

    - #### PROPERTY_DATASOURCE_EXPRESSION

          public static final java.lang.String PROPERTY_DATASOURCE_EXPRESSION

      See Also:
        Constant Field Values

    - #### PROPERTY_EXPRESSION

          public static final java.lang.String PROPERTY_EXPRESSION

      See Also:
        Constant Field Values

    - #### PROPERTY_PARAMETERS_MAP_EXPRESSION

          public static final java.lang.String PROPERTY_PARAMETERS_MAP_EXPRESSION

      See Also:
        Constant Field Values

    - #### PROPERTY_PARAMETERS

          public static final java.lang.String PROPERTY_PARAMETERS

      See Also:
        Constant Field Values

    - #### PROPERTY_RETURN_VALUES

          public static final java.lang.String PROPERTY_RETURN_VALUES

      See Also:
        Constant Field Values

    - #### isUsingCache

          protected java.lang.Boolean isUsingCache

    - #### parametersMap

          protected java.util.Map<java.lang.String,JRSubreportParameter> parametersMap

    - #### returnValues

          protected java.util.List<JRSubreportReturnValue> returnValues

      Values to be copied from the subreport into the master report.

    - #### parametersMapExpression

          protected JRExpression parametersMapExpression

    - #### connectionExpression

          protected JRExpression connectionExpression

    - #### dataSourceExpression

          protected JRExpression dataSourceExpression

    - #### expression

          protected JRExpression expression

  - ### Constructor Detail

    - #### JRDesignSubreport

          public JRDesignSubreport(JRDefaultStyleProvider defaultStyleProvider)

  - ### Method Detail

    - #### getModeValue

          public ModeEnum getModeValue()

      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:
        `getModeValue` in interface `JRCommonElement`
      Overrides:
        `getModeValue` in class `JRBaseElement`

    - #### isUsingCache

          public boolean isUsingCache()

      Deprecated. Replaced by `getUsingCache()`.
      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

    - #### getParametersMapExpression

          public JRExpression getParametersMapExpression()

      Specified by:
        `getParametersMapExpression` in interface `JRSubreport`

    - #### setParametersMapExpression

          public void setParametersMapExpression(JRExpression parametersMapExpression)

    - #### getParameters

          public JRSubreportParameter[] getParameters()

      Specified by:
        `getParameters` in interface `JRSubreport`

    - #### getParametersMap

          public java.util.Map<java.lang.String,JRSubreportParameter> getParametersMap()

    - #### addParameter

          public void addParameter(JRSubreportParameter subreportParameter)
                            throws JRException

      Throws:
        `JRException`

    - #### removeParameter

          public JRSubreportParameter removeParameter(java.lang.String name)

    - #### getConnectionExpression

          public JRExpression getConnectionExpression()

      Specified by:
        `getConnectionExpression` in interface `JRSubreport`

    - #### setConnectionExpression

          public void setConnectionExpression(JRExpression connectionExpression)

    - #### getDataSourceExpression

          public JRExpression getDataSourceExpression()

      Specified by:
        `getDataSourceExpression` in interface `JRSubreport`

    - #### setDataSourceExpression

          public void setDataSourceExpression(JRExpression dataSourceExpression)

    - #### getExpression

          public JRExpression getExpression()

      Specified by:
        `getExpression` in interface `JRSubreport`

    - #### setExpression

          public void setExpression(JRExpression expression)

    - #### collectExpressions

          public void collectExpressions(JRExpressionCollector collector)

      Specified by:
        `collectExpressions` in interface `JRElement`

    - #### visit

          public void visit(JRVisitor visitor)

      Specified by:
        `visit` in interface `JRVisitable`

    - #### addReturnValue

          public void addReturnValue(JRSubreportReturnValue returnValue)

      Adds a return value to the subreport.
      Parameters:
        `returnValue` - the return value to be added.

    - #### getReturnValues

          public JRSubreportReturnValue[] getReturnValues()

      Returns the list of values to be copied from the subreport into the master.
      Specified by:
        `getReturnValues` in interface `JRSubreport`
      Returns:
        the list of values to be copied from the subreport into the master.

    - #### getReturnValuesList

          public java.util.List<JRSubreportReturnValue> getReturnValuesList()

      Returns the list of values to be copied from the subreport into the master.
      Returns:
        list of `JRSubreportReturnValue` objects

    - #### removeReturnValue

          public boolean removeReturnValue(JRSubreportReturnValue returnValue)

      Removes a return value from the subreport.
      Parameters:
        `returnValue` - the return value to be removed
      Returns:
        `true` if the return value was found and removed

    - #### isOwnUsingCache

          public java.lang.Boolean isOwnUsingCache()

      Deprecated. Replaced by `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:
        `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

    - #### getUsingCache

          public java.lang.Boolean 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 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`

    - #### isRunToBottom

          public java.lang.Boolean 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 interface `JRSubreport`
      Returns:
        whether the subreport element will consume the entire space down to the bottom of the page
      See Also:
        `JRSubreport.setRunToBottom(Boolean)`

    - #### setRunToBottom

          public void setRunToBottom(java.lang.Boolean runToBottom)

      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 interface `JRSubreport`
      Parameters:
        `runToBottom` - whether the subreport element will consume the entire space down to the bottom of the page

    - #### getOverflowType

          public OverflowType getOverflowType()

      Specified by:
        `getOverflowType` in interface `JRSubreport`

    - #### setOverflowType

          public void setOverflowType(OverflowType overflowType)

      Specified by:
        `setOverflowType` in interface `JRSubreport`

    - #### clone

          public java.lang.Object clone()

      Specified by:
        `clone` in interface `JRCloneable`
      Overrides:
        `clone` in class `JRDesignElement`

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com