Class actuate.data.Request
Description
Specifies a request for retrieving data and the conditions for that request. This class provides the scope for a request by defining a target element and a range of rows. The scope of the request determines what goes into a ResultSet. Functions that use request can only retrieve ResultSets from report elements that have an explicit bookmark.
Constructor
Syntax
actuate.data.Request(string bookmark, integer startRow, integer maxRow)
Constructs a request object that other classes use to retrieve data.
Parameters
bookmark
String. A bookmark that identifies an Actuate report element. The actuate.data.Request object uses the bookmark to identify the report element to request information from. If null, Request uses the first bookmark. Functions that use request can only retrieve actuate.data.ResultSet objects from report elements that have an explicit bookmark.
startRow
Integer. The numerical index of the requested first row. The smallest value is 0.
maxRow
Integer. The numerical index of the requested last row. 0 indicates no limit.
Function summary
Table 44‑13 lists actuate.data.Request functions.
Table 44‑13 actuate.data.Request functions
Function
Description
Returns the bookmark name
Returns the column names
Returns filters defined in this data condition
Returns the max row number
Returns sorters defined in this data condition
Returns the start row number
Sets the bookmark name
Sets the columns to return
Sets the filters for the returned data
Sets the max row number
Sets the sorters for the returned data
Sets the start row number
getBookmark
Syntax
string Request.getBookmarkName( )
Returns the bookmark name for this request.
Returns
String. The bookmark used in the request object’s constructor.
Example
This example retrieves the bookmark set in the myRequest object:
return myRequest.getBookmarkName( );
getColumns
Syntax
string[ ] Request.getColumns( )
Returns a list of column names that match the request.
Returns
Array of strings. The column names.
Example
This example retrieves the first, third, and fifth column names from the request object myRequest:
function get135Columns(myRequest){
var columns = myRequest.getColumns( );
return columns[0];
return columns[2];
return columns[4];
}
getFilters
Syntax
actuate.data.Filter[ ] Request.getfilters( )
Returns filters set for this request.
Returns
Array of actuate.data.Filter objects.
getMaxRows
Syntax
integer Request.getMaxRows( )
Returns the maximum number of rows to retrieve.
Returns
Integer. The index of the last row in the request. 0 means no limit.
getSorters
Syntax
actuate.data.Sorter[ ] Request.getSorters( )
Returns sorters assigned to this request.
Returns
Array of actuate.data.Sorter objects.
getStartRow
Syntax
Integer Request.getStartRow( )
Returns the index of the starting row as an integer.
Returns
Integer. The startRow value. The first row in a column has an index of 0.
setBookmark
Syntax
void Request.setBookmark(string bookmark)
Sets the bookmark of the element from which to request values.
Parameter
bookmark
String. A bookmark.
Example
This example sets the bookmark for the myRequest object to the string myRequestStart:
function setMyRequestBookmark(myRequest){
myRequest.setBookmark("myRequestStart");
}
setColumns
Syntax
void Request.setColumns(string[ ] columns)
Sets the request column names.
Parameter
columns
An array of strings designating the columns of requested data. Use an array for this argument, even if there is only one value.
setFilters
Syntax
void Request.setFilters(actuate.data.Filter[ ] filters)
Adds filters to a request. Filters further refine the set of data provided by a request. Using setFilter removes the previous filters from the request object. All of the filters set in a request are applied when the request is used.
Parameter
filters
An array of actuate.data.Filter objects or a single actuate.data.Filter object to refine the request. Use an array for this argument, even if there is only one value.
setMaxRows
Syntax
void Request.setMaxRows(integer maxrow)
Sets the maximum number of rows to retrieve.
Parameter
maxrow
Integer. The numerical value of the index for the last row to request. 0 indicates no limit.
Example
This example sets the index of the last row for the myRequest request object to 50:
myRequest.setMaxRows(50);
setSorters
Syntax
void Request.setSorts(actuate.data.Sorter[ ] sorters)
Adds sorters to a request to sort the set of data that a request provides. Sorting the data increases the effectiveness of requests by providing the data in a relevant order. Using setSorters removes the previous sorter objects from the request object. All of the sorters set in a request are applied when the request is used.
Sorters are applied in the order that they occur in the array. For example, if the first sorter specifies sorting on a state column and the second sorter specifies sorting on a city column, the result set is sorted by city within each state.
Parameter
sorters
An array of actuate.data.Sorter objects or a single actuate.data.Sorter object to sort the result of the request. Use an array for this argument, even if there is only one value.
Example
This example sets the alphaNumericSorterSet array in myRequest:
myRequest.setSorters(alphaNumericSorterSet);
setStartRow
Syntax
void Request.setStartRow(integer startrow)
Sets the requested first row.
Parameter
startrow
Integer. The numerical value of the index for the first row to request. The first row in a column has an index of 0.
Example
This example sets the index of the first row for the myRequest request object to 10:
myRequest.setStartRow(10);