API Docs for:
Show:

Xmla.Dataset.Cellset Class

Defined in: ../src/Xmla.js:6565
Module: xmla

This class implements a Cellset object.

You do not need to instantiate objects of this class yourself. Rather, the Xmla.Dataset class creates instances of this class to represent the cells (the value of the measures) of an MDX query. (see getCellset().)

Constructor

Xmla.Dataset.Cellset

()

Defined in ../src/Xmla.js:6565

Methods

cellCount

() Int

Defined in ../src/Xmla.js:6662

Returns the number of cells contained in this cellset. This is the number of cells that is actually present in the cellset - not the number of logical cells. The nuber of logical cells can be be calculated by multiplying the tuple counts of all axes of the data set. The XML/A provider will typically not return empty cells, hence, the cellCount may be less than the logical cell count.

Returns:

Int:

The number of cells in this cellset.

cellOrdinal

() Int

Defined in ../src/Xmla.js:6766

Returns the ordinal number of the current cell. The ordinal is the logical cell pointer, which may be different than the physical cell pointer. To get the physical cell pointer, see curr()

Returns:

Int:

returns the logical cell pointer.

cellOrdinalForTupleIndexes

(
  • tuple
)
Int

Defined in ../src/Xmla.js:6934

Calculate the ordinal based on the specified tuple indexes.

Parameters:

  • tuple int...

    index - a variable list of integer arguments. Arguments represent the index of a tuple on the query axes. Tuple indexes should be specified by descending order of axes. For example, if you have a DataSet with 2 Axes, pass the row tuple index as the first argument, and the column tuple index as the last argument.

Returns:

Int:

The ordinal number for this combination of tuple indexes. This return value can be used as argument for getByOrdinal()

cellProperty

(
  • propertyName
)
Mixed

Defined in ../src/Xmla.js:6734

Return the value of the current property of the current cell. XML/A defines these standard properties:

  • Value
  • FmtValue
  • ForeColor
  • BackColor
Whether all these properties are returned depends on the XML/A provider and on the query. The XML/A provider may return specific additional properties.

Parameters:

  • propertyName String

    The name of the property to retrieve.

Returns:

Mixed:

returns the value of the specified property of the current cell.

close

()

Defined in ../src/Xmla.js:6952

Close this cellset.

curr

() Int

Defined in ../src/Xmla.js:6708

Returns the internal cell pointer. This is the fysical cell pointer. To get the logical cell pointer, see cellOrdinal()

Returns:

Int:

returns the internal cell pointer.

eachCell

(
  • callback
  • scope
  • args
)
Boolean

Defined in ../src/Xmla.js:6837

Iterate through each cell.

Parameters:

  • callback Function()
  • scope Object
  • args Object

Returns:

Boolean:

fetchRangeAsArray

(
  • from
  • to
)
object

Defined in ../src/Xmla.js:6912

Get a range of cells withing the range that fits the specified ordinals. This method is useful to grab a slice of cells for a subset of the axes. (You can use cellOrdinalForTupleIndexes to calculate ordinals in terms of tuple indexes.) The returned range only contains cells that actually exist so the ordinal of adjacent cells may have gaps,

Parameters:

  • from Int
    • the ordinal number indicating the start of the range
  • to Int
    • the ordinal number indicating the end of the range

Returns:

object:
  • An array of cells that fit the specified range.

getByIndex

(
  • index
  • object
)
Object

Defined in ../src/Xmla.js:6860

Get a cell by its physical index. This method should typically not be called by clients. Instead, they should use getByOrdinal()

Parameters:

  • index Int
    • the physical index of the cell within the cellset.
  • object Object
    • optional. An object to copy the properties of the specified cell to. If omitted, a new object will be returned instead.

Returns:

Object:

An object that represents the cell.

getByOrdinal

(
  • ordinal
  • object
)
Object

Defined in ../src/Xmla.js:6873

Get a cell by its logical index.

Parameters:

  • ordinal Int
    • the ordinal number of the cell to retrieve.
  • object Object
    • optional. An object to copy the properties of the specified cell to. If omitted, a new object will be returned instead.

Returns:

Object:

An object that represents the cell.

getByTupleIndexes

(
  • ordinal
)
Object

Defined in ../src/Xmla.js:6943

Get the cell corresponding to the specified tuple indexes.

Parameters:

  • ordinal int...

Returns:

Object:

hasCellProperty

(
  • propertyName
)
Boolean

Defined in ../src/Xmla.js:6717

Check if the cell has the specified property. XML/A defines these standard properties:

  • Value
  • FmtValue
  • ForeColor
  • BackColor
Whether all these properties are returned depends on the XML/A provider and on the query. The XML/A provider may return specific additional properties.

Parameters:

  • propertyName String

    The name of the property to check for.

Returns:

Boolean:

returns true if the current cell has the specified property, false if it doesn't.

hasMoreCells

() Boolean

Defined in ../src/Xmla.js:6683

Check if there are cells to iterate through.

Returns:

Boolean:

true if there are more cells to iterate, false if there are no more cells to iterate.

indexForOrdinal

(
  • ordinal
)
Int

Defined in ../src/Xmla.js:6892

Get the physical cell index for the specified ordinal number. This method is useful to calculate boundaries to retrieve a range of cells.

Parameters:

  • ordinal Int
    • the ordinal number for which the index shoul dbe returned

Returns:

Int:

The physical index.

nextCell

() Int

Defined in ../src/Xmla.js:6691

Advance to the next (physical) cell. Note that this method may appear to be skipping cells. This happens when the XML/A provider omits empty cells in the response.

Returns:

Int:

returns the ordinal of the next cell, or -1 if there was no next cell.

readCell

(
  • object
)
Object

Defined in ../src/Xmla.js:6827

Reads the current cell into the specified object.

Parameters:

  • object Object

    An existing object to use for the current cell. If omitted, a new object will be created.

Returns:

Object:

An object that represents the current cell.

reset

(
  • idx
)

Defined in ../src/Xmla.js:6673

Resets the internal cell pointer to the argument, or to 0 if the argument is omitted. Normally, you shouldn't have to call this method yourself.

Parameters:

  • idx Int