Hello,
Is there a more efficient way of displaying data from
a cellset other than retrieving it on a cell by cell
basis? I am building a cube-browsing client app
where the user might choose to view a large part of
the cube. In an MDX query that returns 3,000 cells, it
takes a couple of seconds to open the cellset, and
then a minute or more to iterate through each of the
3,000 cells. For a larger cellset such as 10,000,
this could take 15 -20 minutes.
My VB code looks like this:
Dim cst As New ADOMD.Cellset
.
.
.
conn.ConnectionString = "Datasource=TestServer; Provider=msolap; Initial
Catalog=Test;"
conn.Open
Set cst.ActiveConnection = conn
cst.Source = MDXQuery
cst.Open
nRowDim = cst.Axes(1).DimensionCount '# Dimensions in the row axis
cRow = cst.Axes(1).Positions.Count 'total # cells in all row
dimensions
nColDim = cst.Axes(0).DimensionCount '# Dimensions in the column axis
cCol = cst.Axes(0).Positions.Count 'total # cells in all column
dimensions
'Iterate through the cell set array values.
'The results are not actually being displayed, just retrieved
nNonNA = 0
For iRow = 0 To cRow - 1
For iCol = 0 To cCol - 1
result = cst(iCol, iRow).Value
Next
Next
The MDXQuery used in the code is a string of the form
select
crossjoin({[Measures].[Sales]},
crossjoin({[5 Times]},{[25 Depts]})) on
columns,
crossjoin({[3 Locations]},{[8 Products]}) on rows
From SALES_CUBE
Thanks,
Grace