net.sf.jasperreports.engine

## Interface JRDatasetRun

- All Superinterfaces:
    java.lang.Cloneable, JRCloneable, JRIdentifiable, JRPropertiesHolder
  All Known Implementing Classes:
    FillDatasetRun, JRBaseDatasetRun, JRDesignDatasetRun, JRFillDatasetRun, MarkerFillDatasetRun

      public interface JRDatasetRun
      extends JRCloneable, JRIdentifiable, JRPropertiesHolder

  Interface of an sub dataset instantiation.

  Once a dataset is declared inside a report template, it can be used only if it's actually referenced by a chart, crosstab or other component. Simply declaring a dataset at the report level does not have any effect.

  When a dataset is referenced by a report component, a dataset run is instantiated. The dataset runs through the supplied data source performing all the variable calculations and the required data grouping.

  A dataset run declaration supplies the values for the dataset parameters as well as the data source through which the dataset will iterate. Optionally, a `java.sql.Connection` can be passed to the dataset instead of a `JRDataSource` instance, when there is a SQL query associated with the dataset. This query is executed by the engine using the JDBC connection and the `java.sql.ResultSet` object obtained is iterated through.

  Dataset runs resemble subreports in the way parameters and the data source/connection are passed in.

  Charts, crosstabs and other report components can reference datasets by instantiating and configuring dataset runs. If no dataset run is specified for a component, the main dataset of the report is used.
  Version:
    $Id: JRDatasetRun.java 7051 2014-04-25 13:46:34Z shertage $
  Author:
    Lucian Chirita (lucianc@users.sourceforge.net)
  See Also:
    `JRDataset`, `JRElementDataset.getDatasetRun()`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JRExpression` | `getConnectionExpression()` Returns the DB connection expression.
    `java.lang.String` | `getDatasetName()` Returns the sub dataset name.
    `JRExpression` | `getDataSourceExpression()` Returns the data source expression.
    `JRDatasetParameter[]` | `getParameters()` Returns the list of parameter values.
    `JRExpression` | `getParametersMapExpression()` Returns the parameters map expression.
    `java.util.List<ReturnValue>` | `getReturnValues()` Returns the list of values to be copied from the subdataset.

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

      `clone`

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

      `getUUID`

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

      `getParentProperties, getPropertiesMap, hasProperties`

- - ### Method Detail

    - #### getDatasetName

          java.lang.String getDatasetName()

      Returns the sub dataset name.
      Returns:
        the sub dataset name

    - #### getParametersMapExpression

          JRExpression getParametersMapExpression()

      Returns the parameters map expression.

      The result of this expression is used as the parameters map when instantiating the dataset.

      Returns:
        the parameters map expression

    - #### getParameters

          JRDatasetParameter[] getParameters()

      Returns the list of parameter values.
      Returns:
        the list of parameter values

    - #### getConnectionExpression

          JRExpression getConnectionExpression()

      Returns the DB connection expression.

      The result of this expression is used as the DB connection when instantiating the dataset.

      Returns:
        the DB connection expression

    - #### getDataSourceExpression

          JRExpression getDataSourceExpression()

      Returns the data source expression.

      The result of this expression is used as the data source when instantiating the dataset.

      Returns:
        the data source expression

    - #### getReturnValues

          java.util.List<ReturnValue> getReturnValues()

      Returns the list of values to be copied from the subdataset.
      Returns:
        the list of copied values.

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com