public interface JRDataset extends JRPropertiesHolder, JRCloneable, JRIdentifiable
<subDataset>
tag.
The engine does not necessarily use a subdataset, once defined in the report. Subdatasets are
instantiated and iterate through the supplied data source to calculate dataset variable values
only if they are referenced by a chart, crosstab or other component's dataset run.
Just like subreports, datasets, when instantiated, expect to receive parameter values and a
data source to iterate through. As a convenience, datasets can have an associated SQL
query that is executed by the engine if a java.sql.Connection object is supplied to
them instead of the usual data source.
Datasets can also have scriptlets associated with them to allow making callbacks to userdefined
business logic during the dataset iteration, if further data manipulation is needed.JRDatasetRun
,
JRReport.getMainDataset()
,
JRReport.getDatasets()
Modifier and Type | Method and Description |
---|---|
JRField[] |
getFields()
Returns the dataset's fields.
|
JRExpression |
getFilterExpression()
Returns the dataset filter expression.
|
JRGroup[] |
getGroups()
Returns the dataset's groups.
|
String |
getName()
Returns the dataset name.
|
JRParameter[] |
getParameters()
Returns the dataset's parameters.
|
DatasetPropertyExpression[] |
getPropertyExpressions()
Returns the list of dynamic/expression-based properties for this dataset.
|
JRQuery |
getQuery()
Returns the query of the dataset.
|
String |
getResourceBundle()
Returns the resource bundle base name.
|
String |
getScriptletClass()
The name of the scriptlet class to be used when iterating this dataset.
|
JRScriptlet[] |
getScriptlets()
Returns the dataset's scriptlets.
|
JRSortField[] |
getSortFields()
Returns the dataset's sort fields.
|
JRVariable[] |
getVariables()
Returns the dataset's variables.
|
WhenResourceMissingTypeEnum |
getWhenResourceMissingTypeValue()
Returns the resource missing handling type.
|
boolean |
isMainDataset()
Decides whether this dataset is the main report dataset or a sub dataset.
|
void |
setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType)
Sets the resource missing handling type.
|
getParentProperties, getPropertiesMap, hasProperties
clone
getUUID
String getName()
String getScriptletClass()
JRScriptlet[] getScriptlets()
DatasetPropertyExpression[] getPropertyExpressions()
JRParameter[] getParameters()
JRQuery getQuery()
The query is used by passing a connection is passed to the dataset when instantiating.
JRField[] getFields()
JRSortField[] getSortFields()
JRVariable[] getVariables()
JRGroup[] getGroups()
boolean isMainDataset()
true
if and only if this dataset is the main report datasetString getResourceBundle()
The resource bundle is used when evaluating expressions.
WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue()
void setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType)
whenResourceMissingType
- the resource missing handling typeJRExpression getFilterExpression()
This expression is used to filter the rows of the
data source
that this dataset will iterate on.
This expression (if not null) is evaluated immediately after a new row is
produced
by the data source.
The evaluation is performed using field and variable values corresponding to the new row.
When the result of the evaluation is Boolean.TRUE
the row gets processed by the report
filling engine.
When the result is null or Boolean.FALSE
, the current row will be skipped and the datasource will be asked for the next row.
Copyright © 2023 Cloud Software Group, Inc.. All rights reserved.