Range Rowsets

The range rowset is a rowset of which each row corresponds to a cell in the dataset. Each selected cell property appears as a column in this rowset. The range rowset can be created from the dataset by the IMDRangeRowset::GetRangeRowset method. The range rowset does not have to contain all the cells of the dataset. A subset of cells may be chosen in a manner similar to IMDDataset::GetCellData. IMDRangeRowset is an optional interface on the dataset object. For information on how to find out if the range rowset is supported by the provider or not, see “Data Source Property, MDPROP_RANGEROWSET.”

Consider the dataset in “Cube and Dataset Example.” The call

IMDRangeRowset::GetRangeRowset(NULL, 1, 19, cProperties, rgPropertySets, 
   &pIRowsetChange);

returns the following rowsets, assuming that the default properties — CELL_ORDINAL, VALUE, and FORMATTED_VALUE — were selected:

CELL_ORDINAL VALUE FORMATTED_VALUE
1 10 “10”
2 20 “20”
3 30 “30”
9 11 “11”
10 21 “21”
11 31 “31”
17 12 “12”
18 22 “22”
19 32 “32”

Note   The quotation marks around values in the FORMATTED_VALUE column are there as a visual aid to point out that they are strings. The provider does not return the quotes.

The primary uses of the range rowset are:

The following rules govern the structure of the range rowset:

  1. The range rowset always contains CELL_ORDINAL as the first column, regardless of whether it was specified in the CELL PROPERTIES clause of the dataset. The other properties appear as subsequent columns, according to the following rules:
    • If the MDX statement that created the dataset had a CELL PROPERTIES clause, then the columns appear in the order specified in that clause.

    • Otherwise, the columns are CELL_ORDINAL, VALUE, and FORMATTED_VALUE, in that order.

    • What happens in these cases is provider-specific:

      Either the MDX statement has CELL_ORDINAL specified in the CELL PROPERTIES clause, but not as the first property (for example, CELL PROPERTIES VALUE, CELL_ORDINAL), or the MDX statement has a property specified multiple times in the CELL PROPERTIES clause (for example, CELL PROPERTIES CELL_ORDINAL, VALUE, FORMATTED_VALUE, VALUE).

  2. The CELL_ORDINAL column is always read-only.

  3. The other columns may or may not be read-only, based on provider-defined conditions. If the range rowset can be updated (that is, if it supports the IRowsetChange interface), then usually at least one column, frequently the VALUE column, can be updated. Providers usually support the updating of other columns as well. To determine if a column can be updated, consumers must check dwFlags in the DBCOLUMNSINFO structure for the column.

  4. The rows in the range rowset are ordered by CELL_ORDINAL column.