Changing measures and dimensions
Edit measures with Crosstab.editMeasure( ). In this example, the measureName measure named measureName takes on a new value:
var measure = new actuate.xtabanalyzer.Measure( );
 
measure.setMeasureName("measureName");
measure.setExpression("measureExpression");
crosstab.editMeasure(measure);
crosstab.submit( );
Use Crosstab.changeMeasureDirection( ) to change the measure direction. Pivot the cross tab with Crosstab.pivot( ).
Use Crosstab.reorderDimension( ) to change the order or axis type of a dimension within a cross tab. This example moves the index of a dimension within a cross tab from 1 to 5. The dimension’s axis type changes from a row axis to a column axis.
var dimIdx = 1;
var newDimIdx = 5
var axis = actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE;
var newAxis = actuate.xtabanalyzer.Dimension.COLUMN_AXIS_TYPE;
crosstab.reorderDimension(dimIdx,axis,newDimIdx,newAxis );
crosstab.submit( );
The measure placement order can be altered using Crosstab.reorderMeasure( ). In this example, a measure’s index changes from position 1 in the cross tab to position 5:
crosstab.reorderMeasure(1,5);
crosstab.submit( );
Measures and dimensions can also be changed with the functions in the measure and dimension classes. In this example, a dimension axis changes from column to row:
var currentAxis = dimension.getAxisType( )
if (currentAxis == actuate.xtabanalyzer.Dimension.COLUMN_AXIS_TYPE){
  dimension.setNewAxisType(
    actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE);
}

Additional Links:

Copyright Actuate Corporation 2012