dbTalk Databases Forums  

ADOMD.net accessing >1 dimension

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss ADOMD.net accessing >1 dimension in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Todd Somervell
 
Posts: n/a

Default ADOMD.net accessing >1 dimension - 04-06-2004 , 05:33 PM






In ADOMD the cell collection index for >1 dimension was an array of
coordinates.
ie: coord(0) = 5: coord(1) = 3: str = cellset(coord)

How does it work in ADOMD.net ?

Will this work (and is it the best way):

Dim conADOMD As New AdomdConnection("Data
Source=http://www.myurl.com/xmla/msxisapi.dll")
Dim strMDX As String = "SELECT {[Style].[All Style].[14].CHILDREN}
ON COLUMNS" & _
", {[Location].[All
Location].[Australia].CHILDREN} ON ROWS" & _
" FROM [Sales]"
Dim myCommand As New AdomdCommand(strMDX, conADOMD)
conADOMD.Open()
Dim cellAnalytics As CellSet = myCommand.ExecuteCellSet
Dim colAnalytics As AdomdClient.Axis = cellAnalytics.Axes(0)
Dim rowAnalytics As AdomdClient.Axis = cellAnalytics.Axes(1)
Dim posFMRow As Position, posFMCol As Position, pos as Long
Dim sb As New StringBuilder()
sb.Append("<TABLE>" & vbCrLf)
For Each posFMRow In rowAnalytics.Positions
sb.Append("<TR>")
For Each posFMCol In colAnalytics.Positions
sb.Append("<TD>")
pos = posFMCol.Ordinal * posFMRow.Ordinal
sb.Append(cellAnalytics(pos).FormattedValue)
sb.Append("</TD>")
Next
sb.Append("</TR>" & vbCrLf)
Next
sb.Append("</TABLE>" & vbCrLf)

Reply With Quote
  #2  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: ADOMD.net accessing >1 dimension - 04-07-2004 , 03:30 AM






ADOMD.NET contains 3 different ways to access cell in the cellset

1. By cell ordinal - this is the method you described below - CellSet(int
cellordinal)
2. Special case for very common queries when you have 2 axes (columns and
rows) - CellSet(int columns, int rows)
3. General n-axes case - CellSet( params int[] indexes)

HTH,
Mosha

--
==================================================
Mosha Pasumansky - http://www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================
"Todd Somervell" <todd (AT) element78 (DOT) co.nz> wrote

Quote:
In ADOMD the cell collection index for >1 dimension was an array of
coordinates.
ie: coord(0) = 5: coord(1) = 3: str = cellset(coord)

How does it work in ADOMD.net ?

Will this work (and is it the best way):

Dim conADOMD As New AdomdConnection("Data
Source=http://www.myurl.com/xmla/msxisapi.dll")
Dim strMDX As String = "SELECT {[Style].[All Style].[14].CHILDREN}
ON COLUMNS" & _
", {[Location].[All
Location].[Australia].CHILDREN} ON ROWS" & _
" FROM [Sales]"
Dim myCommand As New AdomdCommand(strMDX, conADOMD)
conADOMD.Open()
Dim cellAnalytics As CellSet = myCommand.ExecuteCellSet
Dim colAnalytics As AdomdClient.Axis = cellAnalytics.Axes(0)
Dim rowAnalytics As AdomdClient.Axis = cellAnalytics.Axes(1)
Dim posFMRow As Position, posFMCol As Position, pos as Long
Dim sb As New StringBuilder()
sb.Append("<TABLE>" & vbCrLf)
For Each posFMRow In rowAnalytics.Positions
sb.Append("<TR>")
For Each posFMCol In colAnalytics.Positions
sb.Append("<TD>")
pos = posFMCol.Ordinal * posFMRow.Ordinal
sb.Append(cellAnalytics(pos).FormattedValue)
sb.Append("</TD>")
Next
sb.Append("</TR>" & vbCrLf)
Next
sb.Append("</TABLE>" & vbCrLf)




Reply With Quote
  #3  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: ADOMD.net accessing >1 dimension - 04-07-2004 , 03:30 AM



ADOMD.NET contains 3 different ways to access cell in the cellset

1. By cell ordinal - this is the method you described below - CellSet(int
cellordinal)
2. Special case for very common queries when you have 2 axes (columns and
rows) - CellSet(int columns, int rows)
3. General n-axes case - CellSet( params int[] indexes)

HTH,
Mosha

--
==================================================
Mosha Pasumansky - http://www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================

"Todd Somervell" <todd (AT) element78 (DOT) co.nz> wrote

Quote:
In ADOMD the cell collection index for >1 dimension was an array of
coordinates.
ie: coord(0) = 5: coord(1) = 3: str = cellset(coord)

How does it work in ADOMD.net ?

Will this work (and is it the best way):

Dim conADOMD As New AdomdConnection("Data
Source=http://www.myurl.com/xmla/msxisapi.dll")
Dim strMDX As String = "SELECT {[Style].[All Style].[14].CHILDREN}
ON COLUMNS" & _
", {[Location].[All
Location].[Australia].CHILDREN} ON ROWS" & _
" FROM [Sales]"
Dim myCommand As New AdomdCommand(strMDX, conADOMD)
conADOMD.Open()
Dim cellAnalytics As CellSet = myCommand.ExecuteCellSet
Dim colAnalytics As AdomdClient.Axis = cellAnalytics.Axes(0)
Dim rowAnalytics As AdomdClient.Axis = cellAnalytics.Axes(1)
Dim posFMRow As Position, posFMCol As Position, pos as Long
Dim sb As New StringBuilder()
sb.Append("<TABLE>" & vbCrLf)
For Each posFMRow In rowAnalytics.Positions
sb.Append("<TR>")
For Each posFMCol In colAnalytics.Positions
sb.Append("<TD>")
pos = posFMCol.Ordinal * posFMRow.Ordinal
sb.Append(cellAnalytics(pos).FormattedValue)
sb.Append("</TD>")
Next
sb.Append("</TR>" & vbCrLf)
Next
sb.Append("</TABLE>" & vbCrLf)



Reply With Quote
  #4  
Old   
Todd Somervell
 
Posts: n/a

Default Re: ADOMD.net accessing >1 dimension - 04-07-2004 , 04:48 PM



Did I mention that I am using ADOMD.Net with XML/A 1.1 ?

The version of ADOMD.Net that I have does not allow CellSet(col,row)
or CellSet(coords[]). Is there a newer version?

Could you please confirm that CellSet(col * row) is correct.

Todd

"Mosha Pasumansky [MS]" <moshap (AT) online (DOT) microsoft.com> wrote

Quote:
ADOMD.NET contains 3 different ways to access cell in the cellset

1. By cell ordinal - this is the method you described below - CellSet(int
cellordinal)
2. Special case for very common queries when you have 2 axes (columns and
rows) - CellSet(int columns, int rows)
3. General n-axes case - CellSet( params int[] indexes)

HTH,
Mosha

--
==================================================
Mosha Pasumansky - http://www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================
"Todd Somervell" <todd (AT) element78 (DOT) co.nz> wrote in message
news:c293a38.0404061438.5bbccf1f (AT) posting (DOT) google.com...
In ADOMD the cell collection index for >1 dimension was an array of
coordinates.
ie: coord(0) = 5: coord(1) = 3: str = cellset(coord)

How does it work in ADOMD.net ?

Will this work (and is it the best way):

Dim conADOMD As New AdomdConnection("Data
Source=http://www.myurl.com/xmla/msxisapi.dll")
Dim strMDX As String = "SELECT {[Style].[All Style].[14].CHILDREN}
ON COLUMNS" & _
", {[Location].[All
Location].[Australia].CHILDREN} ON ROWS" & _
" FROM [Sales]"
Dim myCommand As New AdomdCommand(strMDX, conADOMD)
conADOMD.Open()
Dim cellAnalytics As CellSet = myCommand.ExecuteCellSet
Dim colAnalytics As AdomdClient.Axis = cellAnalytics.Axes(0)
Dim rowAnalytics As AdomdClient.Axis = cellAnalytics.Axes(1)
Dim posFMRow As Position, posFMCol As Position, pos as Long
Dim sb As New StringBuilder()
sb.Append("<TABLE>" & vbCrLf)
For Each posFMRow In rowAnalytics.Positions
sb.Append("<TR>")
For Each posFMCol In colAnalytics.Positions
sb.Append("<TD>")
pos = posFMCol.Ordinal * posFMRow.Ordinal
sb.Append(cellAnalytics(pos).FormattedValue)
sb.Append("</TD>")
Next
sb.Append("</TR>" & vbCrLf)
Next
sb.Append("</TABLE>" & vbCrLf)

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.