Eclipse BIRT Report Object Model (ROM)
ScriptDataSet Element
Display Name: | Script Data Set |
Since: | 1.0 |
XML Element: | script-data-set |
Extends: | SimpleDataSet |
Extendable: | Yes |
Abstract: | No |
Name Space: | Data Sets |
Name Requirement: | Required |
Allows User Properties: | Yes |
Has Style: | No |
cachedMetaData, columnHints, comments, computedColumns, customXml, dataSetRowLimit, dataSource, displayName, displayNameID, eventHandlerClass, extends, filter, name, paramBindings, propertyMasks, refTemplateParameter, resultSetHints, rowFetchLimit, userProperties, viewAction
beforeOpen, beforeClose, onFetch, afterOpen, afterClose
Represents a data set defined in JavaScript code, providing methods for opening, fetching and closing the data set. It defines the overall properties of the scripted data set including the JavaScript methods themselves and an optional result set definition.
Script Data Source element
DataSet
scripting object
Defines the data access attributes of the list of input and/or output parameters.
Type: | List of DataSetParam Structures |
Since: | 1.0 |
Required: | No |
Display Name: | Data set parameters |
JavaScript Type: | |
Default Value: | None |
Inherited: | Yes |
Runtime Settable: | Yes |
Property Sheet Visibility: | Hidden |
Property Sheet Group: | Top |
Many data sets allow parameters, which can be of input and/or output modes. For some, the user must define the parameters as part of the data set definition. For other data sets, the driver itself can provide the set of parameter definitions from the information available in a data set query. In the latter case, parameter definitions are derived data and are not stored in the parameter definition.
Some drivers refer to a parameter by position. Others can refer to a parameter by name. Also, for some data sets, the data set definition can omit parameter definitions for optional parameters not used within the report. Not all parameter properties are required. If a property is omitted. BIRT assumes that the data set implementation can provide it at run time. If the driver cannot provide the information, then a runtime error occurs. This is an optional list of data set parameter definitions, used only when the underlying data provider cannot provide this information. When contradicting meta-data are found between those provided dynamically by a data provider and those specified in a data set definition, the data provider�s meta-data takes precedence.
DataSetParam structure
ParamBinding structure
Called by BIRT to close the data set.
None obj.close( )
Since: | 1.0 |
Context: | factory |
Arguments: | None |
Return Type: | None |
Closes the data set. Optional.
beforeClose
method
afterClose
method
Dynamically describes the result set definition in JavaScript.
ColumnDefn[] obj.describe( )
Since: | reserved |
Context: | factory |
Arguments: | None |
Return Type: | ColumnDefn[] |
The Describe method can return null, which tells BIRT to use the static definition instead. The script can access the static description using the design object within the script.
If the method returns a column array, then the array must satisfy the following constraints:
Called before BIRT calls the
beforeOpen
method. Creates a
runt-time definition of the result set columns. Returns an array of
ResultSetColumn objects. Each object describes a column in the expected result
set. Optional.
ResultSetColumn
structure
Fetches a row from the data set.
DataRow obj.fetch( )
Since: | 1.0 |
Context: | factory |
Arguments: | None |
Return Type: | DataRow |
Returns true
if there is another row to fetch, false
if there are no more
rows. When the data set has returned the last row from the result set,
subsequent calls to
fetch
should return false
.
Fetches a row from the data set on each call, and populates the current row
available in the row
property.
onFetch
method
DataRow scripting object
Opens the data set.
None obj.open( )
Since: | 1.0 |
Context: | factory |
Arguments: | None |
Return Type: | None |
Opens the external data set. Throws a JavaScript exception if the open fails. Often refers to report parameters or user-defined parameters for information about the data set. Optional.
beforeOpen
method
afterOpen
method