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 5-10 lists actuate.xtabanalyzer.GrandTotal functions.
actuate.xtabanalyzer.GrandTotal.addTotal
Syntax  
void GrandTotal.addTotal(object total)
Adds a total to the cross tab.
Parameters    
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);
  }
}
actuate.xtabanalyzer.GrandTotal.getAxisType
Syntax  
integer GrandTotal.getAxisType( )
Returns the axis type for the total.
Returns
Integer. The following values are legal axis types:
*
*
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);
  }
}
actuate.xtabanalyzer.GrandTotal.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( );
}
actuate.xtabanalyzer.GrandTotal.getType
Syntax  
string GrandTotal.getType( )
Returns the type for the total.
Returns
String. The total type.
actuate.xtabanalyzer.GrandTotal.setAxisType
Syntax  
void GrandTotal.setAxisType(integer axisType)
Sets the axis type for the total.
Parameters
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);
  }
}
actuate.xtabanalyzer.GrandTotal.setTotals
Syntax  
void GrandTotal.setTotals(actuate.xtabanalyzer.Total[ ] totals)
Sets totals as an array.
    Parameters
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( ));

Additional Links:

Copyright Actuate Corporation 2012