BIRT Data Analyzer API classes : Class actuate.xtabanalyzer.Dimension

Class actuate.xtabanalyzer.Dimension

Description

The Dimension class specifies a cross tab dimension object.

Constructor

Syntax

actuate.xtabanalyzer.Dimension( )

The Dimension class is used to specify a dimension object.

Function summary

Table 5-4 lists actuate.xtabanalyzer.Dimension functions.

actuate.xtabanalyzer.Dimension.addLevel

Syntax

void Dimension.addLevel(actuate.xtabanalyzer.Level level)

Adds a level to the dimension.

Parameters

level

actuate.xtabanalyzer.Level object. An instance of a level object to add to the dimension.

Example

This example adds a level to a dimension.

function addLvl(dimension,levelName){
  var level = new actuate.xtabanalyzer.Level( );
  level.setLevelName(levelName);
  dimension.addLevel(level);
}

actuate.xtabanalyzer.Dimension.getAxisType

Syntax

integer Dimension.getAxisType( )

Retrieves the axis type for the dimension.

Returns

String containing the axis type. The axis type can be one of the following values:

n  
n  

Example

This example retrieves and sets the axis type.

function swapAxis(dimension){
  if (dimension.getAxisType( ) == actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE){
    dimension.setNewAxistType(
    actuate.xtabanalyzer.Dimension.COLUMN_AXIS_TYPE);
  } else {  
    dimension.setNewAxistType(
    actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE);
  }
}

actuate.xtabanalyzer.Dimension.getDimensionName

Syntax

string Dimension.getDimensionName( )

Retrieves the name of the dimension.

Returns

String containing the dimension name.

Example

This example retrieves the dimension name.

function getDimName(dimension){
  if(dimension){
    return dimension.getDimensionName( );
  }
  return null;
}

actuate.xtabanalyzer.Dimension.getIndex

Syntax

integer Dimension.getIndex( )

Retrieves the dimension index.

Returns

Integer containing the dimension index.

Example

This example retrieves and increments the index.

function incrementIndex(dimension){
  var newIndex = dimension.getIndex( ) + 1;
  dimension.setNewIndex(newIndex);
}

actuate.xtabanalyzer.Dimension.getLevels

Syntax

string Dimension.getLevels( )

Retrieves the dimension levels.

Returns

String containing the dimension levels.

Example

This example retrieves the dimension name.

function getDimLevels(dimension){
  if(dimension){
    return dimension.getLevels( );
  }
  return null;
}

actuate.xtabanalyzer.Dimension.getNewAxisType

Syntax

integer Dimension.getNewAxisType( )

Retrieves the new axis type.

Returns

Integer containing the new axis type.

Example

This example retrieves the new axis type.

function getNewDimAxis(dimension){
  if(dimension){
    return dimension.getNewAxisType( );
  }
  return null;
}

actuate.xtabanalyzer.Dimension.getNewIndex

Syntax

integer Dimension.getNewIndex( )

Retrieves the new index.

Returns

Integer containing the new index.

Example

This example retrieves the new index.

function getNewDimIndex(dimension){
  if(dimension){
    return dimension.getNewIndex( );
  }
  return null;
}

actuate.xtabanalyzer.Dimension.setAxisType

Syntax

void Dimension.setAxisType(integer axisType)

Sets the axis type when creating a new dimension. Use setNewAxisType( ) to change a dimension that already exists.

Parameters    

axisType

The axis type for the dimension. The axis type has the following legal values:

n  
n  

Example

This example sets the axis type for a new dimension.

function setRowAxis(dimension){
    dimension.setAxistType(
    actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE);
}

actuate.xtabanalyzer.Dimension.setDimensionName

Syntax

void Dimension.setDimensionName(string dimensionName)

Sets the name for a dimension during its creation.

Parameters    

dimensionName

String. The name of the dimension.

Example

This example sets the dimension name to a value taken from a page element.

function setDimensionName(dimension){
  var dimensionName = document.getElementById("dimensionName").value;
  dimension.setDimensionName(dimensionName);
}

actuate.xtabanalyzer.Dimension.setIndex

Syntax

void Dimension.setIndex(integer index)

Sets the index for the dimension

Parameters    

index

The index of the dimension.

Example

This example sets the dimension index to a value taken from a page element.

function setDimensionIndex(dimension){
  var dimensionIndex = document.getElementById("dimensionIndex").value;
  dimension.setIndex(dimensionIndex);
}

actuate.xtabanalyzer.Dimension.setLevels

Syntax

void Dimension.setLevels(xtabanalyzer.Level[ ] levels)

Sets levels for the dimension

Parameters    

levels

Array of xtabanalyzer.Level objects representing the levels for the dimension.

Example

This example sets the dimension levels.

function setDimensionLevels(dimension,levels){
  if (dimension && levels){
    dimension.setLevels(levels);
  }
}

actuate.xtabanalyzer.Dimension.setNewAxisType

Syntax

void Dimension.setNewAxisType(integer newAxisType)

Sets the new axis type.

Parameters    

newAxisType

The new axis type.

Example

This example retrieves and changes the axis type.

function swapAxis(dimension){
  if (dimension.getAxisType( ) ==
      actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE){
    dimension.setNewAxisType(
      actuate.xtabanalyzer.Dimension.COLUMN_AXIS_TYPE);
  } else {
    dimension.setNewAxisType(
      actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE);
  }
}

actuate.xtabanalyzer.Dimension.setNewIndex

Syntax

void Dimension.setNewtIndex(integer newIndex)

Sets the new index.

Parameters    

newIndex

The new index.

Example

This example retrieves and increments the index.

function incrementIndex(dimension){
  var newIndex = dimension.getIndex( ) + 1;
  dimension.setNewIndex(newIndex);
}

(c) Copyright Actuate Corporation 2011