Class actuate.xtabanalyzer.GrandTotal
Description
The GrandTotal class specifies a cross tab GrandTotal object.
Constructor
Syntax
actuate.xtabanalyzer.GrandTotal( )
Constructs a new GrandTotal object.
Function summary
Table 8‑10 lists actuate.xtabanalyzer.GrandTotal functions.
Table 8‑10 actuate.xtabanalyzer.GrandTotal functions 
Function
Description
Adds a total
Returns the axis type
Returns the totals array
Returns the grand total type
Sets the axis type
Sets the totals array
addTotal
Syntax
void GrandTotal.addTotal(object total)
Adds a total to the cross tab.
Parameter
total
actuate.xtabanalyzer.total. The total to add to the cross tab.
Example
This example adds totals to a grand total:
function addTotal(grandTotal){
// The indexStr can be set from a web page or other source as
// necessary.
var indexStr = "0;1;2;3;4";
var indexs = indexsStr.split(";");
var count = indexs.length;
var measureIndexs = [ ];
for(var i = 0;i < count;i++){
measureIndexs.push(parseInt(indexs[i]));
}
for( var i = 0; i < measureIndexs.length; i++){
var total = new actuate.xtabanalyzer.Total( );
total.setMeasureIndex(measureIndexs[i]);
total.setAggregationFunction("SUM");
total.setEnabled(true);
grandTotal.addTotal(total);
}
}
getAxisType
Syntax
integer GrandTotal.getAxisType( )
Returns the axis type for the total.
Returns
Integer. The following values are legal axis types:
*actuate.xtabanalyzer.Dimension.COLUMN_AXIS_TYPE
*actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE
Example
This example retrieves and sets the axis type:
function swapAxis(grandtotal){
if (grandtotal.getAxisType( ) == actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE){
grandtotal.setNewAxisType(
actuate.xtabanalyzer.Dimension.COLUMN_AXIS_TYPE);
} else {
grandtotal.setNewAxisType(
actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE);
}
}
getTotals
Syntax
object[ ] GrandTotal.getTotals( )
Returns an array containing the totals.
Returns
Array of Total objects. The totals.
Example
This example retrieves totals from a GrandTotal object:
var totalsArray = [ ];
function getTotals(grandTotal,totalsArray){
totalsArray = grandTotal.getTotals( );
}
getType
Syntax
string GrandTotal.getType( )
Returns the type for the total.
Returns
String. The total type.
setAxisType
Syntax
void GrandTotal.setAxisType(integer axisType)
Sets the axis type for the total.
Parameter
axisType
Integer. Axis type for the total.
Example
This example retrieves and sets the axis type:
function swapAxis(grandtotal){
if (grandtotal.getAxisType( ) ==
actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE){
grandtotal.setNewAxisType(
actuate.xtabanalyzer.Dimension.COLUMN_AXIS_TYPE);
} else {
grandtotal.setNewAxisType(
actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE);
}
}
setTotals
Syntax
void GrandTotal.setTotals(actuate.xtabanalyzer.Total[ ] totals)
Sets totals as an array.
Parameter
totals
Array of actuate.xtabanalyzer.Total objects to add to the grand total.
Example
This example copies the totals from grandtotal1 into grandtotal2:
grandtotal2.setTotals(grandtotal1.getTotals( ));