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 4-13 lists actuate.data.Request functions.
Table 4-13  
actuate.data.Request.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( );
actuate.data.Request.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];
}
actuate.data.Request.getFilters
Syntax
actuate.data.Filter[ ] Request.getfilters( )
Returns filters set for this request.
Returns
Array of actuate.data.Filter objects.
actuate.data.Request.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.
actuate.data.Request.getSorters
Syntax
actuate.data.Sorter[ ] Request.getSorters( )
Returns sorters assigned to this request.
Returns
Array of actuate.data.Sorter objects.
actuate.data.Request.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.
actuate.data.Request.setBookmark
Syntax
void Request.setBookmark(string bookmark)
Sets the bookmark of the element from which to request values.
Parameters
bookmark
String. A bookmark.
Example
This example sets the bookmark for the myRequest object to the string myRequestStart:
function setMyRequestBookmark(myRequest){
  myRequest.setBookmark("myRequestStart");
}
actuate.data.Request.setColumns
Syntax
void Request.setColumns(string[ ] columns)
Sets the request column names.
Parameters
columns
An array of strings designating the columns of requested data. Use an array for this argument, even if there is only one value.
actuate.data.Request.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.
Parameters
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.
actuate.data.Request.setMaxRows
Syntax
void Request.setMaxRows(integer maxrow)
Sets the maximum number of rows to retrieve.
Parameters
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);
actuate.data.Request.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.
Parameters
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);
actuate.data.Request.setStartRow
Syntax
void Request.setStartRow(integer startrow)
Sets the requested first row.
Parameters
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);

Additional Links:

Copyright Actuate Corporation 2012