![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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) |
#3
| |||
| |||
|
|
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) |
#4
| |||
| |||
|
|
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) |
![]() |
| Thread Tools | |
| Display Modes | |
| |