Table 5-3 lists actuate.xtabanalyzer.Crosstab functions.
var dimension = new actuate.xtabanalyzer.Dimension
( );
dimension.setAxisType(actuate.xtabanalyzer.Dimension.COLUMN_AXIS_TYPE);
dimension.setDimensionName("dates");
var level = new actuate.xtabanalyzer.Level
( );
level.setLevelName("year");
dimension.addLevel(level);
var level = new actuate.xtabanalyzer.Level
( );
level.setLevelName("quarter");
dimension.addLevel(level);
crosstab.addDimension(dimension);
Integer. The options for the add measure operation. These options distinguish the function call’s origin, which can be from another dialog or directly from the Actuate JavaScript API.
var measure = new actuate.xtabanalyzer.Measure
( );
measure.setMeasureName("Quarter Rate");
measure.setExpression("[revenue]/[revenue_SalesDate/year_Product/PRODUCTLINE]");
crosstab.addMeasure(measure);
In this example, the expression set with setExpression( ) is in easyscript, which is described in
Using Actuate BIRT Designer Professional.
String or actuate.xtabanalyzer.Options object. When measureDirection is a string, measureDirection is set to horizontal or vertical and the other parameters set options individually. When an actuate.xtabanalyzer.Options object is specified, all the options are set using settings from this object and applyOptions ignores all subsequent parameters.
crosstab.changeMeasureDirection
( );
actuate.xtabanalyzer.Level object. Optional. The level from which to clear the filters. To clear all filters, do not specify a level.
String. Optional. The filter type. To clear all filter types, do not specify a filter type.
crosstab.clearFilters("filterLevel");
actuate.xtabanalyzer.Driller object. The driller object specifies drill conditions on a dimension.
var driller = new actuate.xtabanalyzer.Driller( );
driller.setAxisType(actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE);
driller.addMember(memberVal);
myCrosstab.drill(driller);
var driller = new actuate.xtabanalyzer.Driller( );
driller.setAxisType(actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE);
driller.addMember(memberVal);
myCrosstab.drillDown(driller);
var driller = new actuate.xtabanalyzer.Driller( );
driller.setAxisType(actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE);
driller.addMember(memberVal);
myCrosstab.drillUp(driller);
Integer. Optional. Options for the editMeasure function. These options distinguish the function call’s origin, which can be from another dialog or directly from the Actuate JavaScript API.
var measure = new actuate.xtabanalyzer.Measure
( );
measure.setMeasureName("measureName");
measure.setExpression("measureExpression");
crosstab.editMeasure(measure);
var crosstabBookmark = crosstab.getBookmark
( );
alert( "No cross tab bookmark found!" )
string[ ] Crosstab.getColumn(integer columnIndex)
String[ ]. The column data as an array of strings. This function returns null when the value of columnIndex is out of range. This function only returns data from the current visible page.
var columnData = crosstab.getColumn(index);
alert( "Invalid column index!" )
return columnData[value];
var HTMLDom = crosstab.getHtmlDom
( );
var container = HTMLDom.getElementById(containerName);
Returns the page content from the current page to which this cross tab belongs. This function returns the same information as XTabAnalyzer.getCurrentPageContent( ).
return crosstab.getPageContent
( );
string[ ] Crosstab.getRow(integer rowIndex)
String[ ]. The row data as an array of string values. This function returns null when the value of rowIndex is out of range. This function only returns data from the current visible page.
var rowData = crosstab.getRow(index);
alert( "Invalid row index!" )
var levelName = "rollLevelName";
crosstab.hideDetail(levelName);
crosstab.removeDimension("dimensionName",null,"levelName";);
var newDimensionIndex = 2;
var axisType = actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE;
var newAxisType = actuate.xtabanalyzer.Dimension.COLUMN_AXIS_TYPE;
crosstab.reorderDimension(dimensionIndex, axisType, newDimensionIndex, newAxisType);
crosstab.removeMeasure("measureName");
crosstab.reorderMeasure(index,newIndex);
var levelName = "levelName";
var operator = "BETWEEN";
var filterValue = "20000;50000";
var filter = new actuate.xtabanalyzer.Filter(levelName, operator);
filter.setValues(filterValue.split(";"));
crosstab.setFilters(filter);
var levelName = "levelName";
var sortAscending = true;
var sorter = new actuate.xtabanalyzer.Sorter(levelName);
sorter.setAscending(sortAscending);
crosstab.setSorters(sorter);
var grandTotal = new actuate.xtabanalyzer.GrandTotal
( );
actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE);
var total = new actuate.xtabanalyzer.Total
( );
total.setMeasureIndex(1);
total.setAggregationFunction("SUM");
grandTotal.addTotal(total);
crosstab.setTotals(grandTotal);
var axisType = actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE;
crosstab.showDetail(axisType);
Function. Optional. The function called when submit( ) completes. This function receives the current XTabAnalyzer object as an input parameter.
This example uses submit( ) to confirm changes to the cross tab:
var axisType = actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE;
crosstab.showDetail(axisType);