<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16527" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana
color=#000080 size=2>You need to work with the mondrian.olap.Result object, not
the formatted output. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana
color=#000080 size=2>To give you an idea how the API works, take a look at the
code that produced your output. It is in
ResultBase.java:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana
color=#000080 size=2> public void print(PrintWriter pw)
{<BR> for (int i = -1; i <
axes.length; i++)
{<BR>
pw.println("Axis #" + (i + 1) +
":");<BR>
printAxis(pw, i < 0 ? slicerAxis :
axes[i]);<BR>
}<BR> // Usually there are 3 axes:
{slicer, columns, rows}. Position is
a<BR> // {column, row} pair. We call
printRows with axis=2. When it
recurses<BR> // to axis=-1, it
prints.<BR> int[] pos = new
int[axes.length];<BR> printRows(pw,
axes.length - 1, pos);<BR> }</FONT></SPAN></DIV><SPAN
class=307123116-28092007><FONT face=Verdana color=#000080 size=2>
<DIV dir=ltr align=left><BR> private void
printRows(PrintWriter pw, int axis, int[] pos)
{<BR> Axis _axis = axis < 0 ?
slicerAxis : axes[axis];<BR>
List<Position> positions =
_axis.getPositions();<BR> int i =
0;<BR> for (Position position:
positions)
{<BR> if (axis
< 0)
{<BR>
if (i > 0)
{<BR>
pw.print(",
");<BR>
}<BR>
printCell(pw,
pos);<BR> }
else
{<BR>
pos[axis] =
i;<BR>
if (axis == 0)
{<BR>
int row = axis + 1 < pos.length ? pos[axis + 1] :
0;<BR>
pw.print("Row #" + row + ":
");<BR>
}<BR>
printRows(pw, axis - 1,
pos);<BR>
if (axis == 0)
{<BR>
pw.println();<BR>
}<BR>
}<BR>
i++;<BR> }<BR>
}<BR></DIV>
<DIV dir=ltr align=left> private void printAxis(PrintWriter
pw, Axis axis) {<BR>
List<Position> positions =
axis.getPositions();<BR> for (Position
position: positions)
{<BR> boolean
firstTime =
true;<BR>
pw.print("{");<BR>
for (Member member: position)
{<BR>
if (! firstTime)
{<BR>
pw.print(",
");<BR>
}<BR>
pw.print(member.getUniqueName());<BR>
firstTime =
false;<BR>
}<BR>
pw.println("}");<BR>
}<BR> }<BR></DIV>
<DIV dir=ltr align=left> private void printCell(PrintWriter
pw, int[] pos) {<BR> Cell cell =
getCell(pos);<BR>
pw.print(cell.getFormattedValue());<BR>
}<BR></DIV></FONT></SPAN>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana
color=#000080 size=2>Something involving Result.getAxes(), Axis.getPositions(),
and Cell.getValue() should solve your problem. To get Double values, you may
need to cast the result of getValue(), like this: ((Number)
cell.getValue()).doubleValue().</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana
color=#000080 size=2>Julian</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV><FONT face=Verdana color=#000080
size=2></FONT><FONT face=Verdana color=#000080 size=2></FONT><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mondrian-bounces@pentaho.org
[mailto:mondrian-bounces@pentaho.org] <B>On Behalf Of </B>Smruti
Naik<BR><B>Sent:</B> Thursday, September 27, 2007 11:45 PM<BR><B>To:</B>
mondrian@pentaho.org<BR><B>Subject:</B> [Mondrian] Reg .MDX Query
Result<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Hello ,</DIV>
<DIV> </DIV>
<DIV>I need to Insert MDX Query Result in Double Type Array List .</DIV>
<DIV> </DIV>
<DIV>Suppose My Result is ,</DIV>
<DIV>Axis #0:<BR>{}<BR>Axis #1:<BR>{[Measures].[Application Time]}<BR>Axis
#2:<BR>{[Time].[2007].[Q3 ].[9].[12]}<BR>{[Time].[2007].[Q3
].[9].[13]}<BR>{[Time].[2007].[Q3 ].[9].[14]}<BR>{[Time].[2007].[Q3
].[9].[15]}<BR>{[Time].[2007].[Q3 ].[9].[16]} <BR>{[Time].[2007].[Q3
].[9].[17]}<BR>{[Time].[2007].[Q3 ].[9].[18]}<BR>{[Time].[2007].[Q3
].[9].[19]}<BR>{[Time].[2007].[Q3 ].[9].[20]}<BR>{[Time].[2007].[Q3
].[9].[21]}<BR>{[Time].[2007].[Q3 ].[9].[22]}<BR>{[Time].[2007].[Q3
].[9].[23]} <BR>{[Time].[2007].[Q3 ].[9].[24]}<BR>{[Time].[2007].[Q3
].[9].[25]}<BR>{[Time].[2007].[Q3 ].[9].[26]}<BR>{[Time].[2007].[Q3
].[9].[27]}<BR>Row #0: 1,337<BR>Row #1: 936<BR>Row #2: 971<BR>Row #3:<BR>Row
#4:<BR>Row #5: 4,272 <BR>Row #6: 1,682<BR>Row #7: 1,189<BR>Row #8:
4,156<BR>Row #9: 4,290<BR>Row #10:<BR>Row #11:<BR>Row #12: 3,651<BR>Row #13:
4,307<BR>Row #14: 4,626<BR>Row #15: 5,864</DIV>
<DIV> </DIV>
<DIV>I wan to Insert this Row # to ArrayList . Can anyone please help me ?
</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV>Smruti</DIV></BLOCKQUOTE></BODY></HTML>