Xmla.Dataset.Cellset Class
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
()
Item Index
Methods
cellCount
()
Int
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:
The number of cells in this cellset.
cellOrdinal
()
Int
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:
returns the logical cell pointer.
cellOrdinalForTupleIndexes
-
tuple
Calculate the ordinal based on the specified tuple indexes.
Parameters:
-
tupleint...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:
The ordinal number for this combination of tuple indexes. This return value can be used as argument for getByOrdinal()
cellProperty
-
propertyName
Return the value of the current property of the current cell. XML/A defines these standard properties:
ValueFmtValueForeColorBackColor
Parameters:
-
propertyNameStringThe name of the property to retrieve.
Returns:
returns the value of the specified property of the current cell.
close
()
Close this cellset.
curr
()
Int
Returns the internal cell pointer. This is the fysical cell pointer.
To get the logical cell pointer, see cellOrdinal()
Returns:
returns the internal cell pointer.
eachCell
-
callback -
scope -
args
Iterate through each cell.
Parameters:
-
callbackFunction() -
scopeObject -
argsObject
Returns:
fetchRangeAsArray
-
from -
to
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:
-
fromInt- the ordinal number indicating the start of the range
-
toInt- the ordinal number indicating the end of the range
Returns:
- An array of cells that fit the specified range.
getByIndex
-
index -
object
Get a cell by its physical index.
This method should typically not be called by clients.
Instead, they should use getByOrdinal()
Parameters:
-
indexInt- the physical index of the cell within the cellset.
-
objectObject- optional. An object to copy the properties of the specified cell to. If omitted, a new object will be returned instead.
Returns:
An object that represents the cell.
getByOrdinal
-
ordinal -
object
Get a cell by its logical index.
Parameters:
-
ordinalInt- the ordinal number of the cell to retrieve.
-
objectObject- optional. An object to copy the properties of the specified cell to. If omitted, a new object will be returned instead.
Returns:
An object that represents the cell.
getByTupleIndexes
-
ordinal
Get the cell corresponding to the specified tuple indexes.
Parameters:
-
ordinalint...
Returns:
hasCellProperty
-
propertyName
Check if the cell has the specified property. XML/A defines these standard properties:
ValueFmtValueForeColorBackColor
Parameters:
-
propertyNameStringThe name of the property to check for.
Returns:
returns true if the current cell has the specified property, false if it doesn't.
hasMoreCells
()
Boolean
Check if there are cells to iterate through.
Returns:
true if there are more cells to iterate, false if there are no more cells to iterate.
indexForOrdinal
-
ordinal
Get the physical cell index for the specified ordinal number. This method is useful to calculate boundaries to retrieve a range of cells.
Parameters:
-
ordinalInt- the ordinal number for which the index shoul dbe returned
Returns:
The physical index.
nextCell
()
Int
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:
returns the ordinal of the next cell, or -1 if there was no next cell.
readCell
-
object
Reads the current cell into the specified object.
Parameters:
-
objectObjectAn existing object to use for the current cell. If omitted, a new object will be created.
Returns:
An object that represents the current cell.
reset
-
idx
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:
-
idxInt
