<!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>&nbsp;</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&nbsp;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>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana 
color=#000080 size=2>&nbsp;&nbsp;&nbsp; public void print(PrintWriter pw) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = -1; i &lt; 
axes.length; i++) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
pw.println("Axis #" + (i + 1) + 
":");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
printAxis(pw, i &lt; 0 ? slicerAxis : 
axes[i]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Usually there are 3 axes: 
{slicer, columns, rows}. Position is 
a<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // {column, row} pair. We call 
printRows with axis=2. When it 
recurses<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // to axis=-1, it 
prints.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int[] pos = new 
int[axes.length];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printRows(pw, 
axes.length - 1, pos);<BR>&nbsp;&nbsp;&nbsp; }</FONT></SPAN></DIV><SPAN 
class=307123116-28092007><FONT face=Verdana color=#000080 size=2>
<DIV dir=ltr align=left><BR>&nbsp;&nbsp;&nbsp; private void 
printRows(PrintWriter pw, int axis, int[] pos) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Axis _axis = axis &lt; 0 ? 
slicerAxis : axes[axis];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
List&lt;Position&gt; positions = 
_axis.getPositions();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int i = 
0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (Position position: 
positions) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (axis 
&lt; 0) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if (i &gt; 0) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
pw.print(", 
");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
pw.println();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
i++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; 
}<BR></DIV>
<DIV dir=ltr align=left>&nbsp;&nbsp;&nbsp; private void printAxis(PrintWriter 
pw, Axis axis) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
List&lt;Position&gt; positions = 
axis.getPositions();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (Position 
position: positions) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean 
firstTime = 
true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
pw.print("{");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
for (Member member: position) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if (! firstTime) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
pw.print(", 
");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
pw.print(member.getUniqueName());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
firstTime = 
false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
pw.println("}");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp; }<BR></DIV>
<DIV dir=ltr align=left>&nbsp;&nbsp;&nbsp; private void printCell(PrintWriter 
pw, int[] pos) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cell cell = 
getCell(pos);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
pw.print(cell.getFormattedValue());<BR>&nbsp;&nbsp;&nbsp; 
}<BR></DIV></FONT></SPAN>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=307123116-28092007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</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>&nbsp;</DIV>
  <DIV>I need to Insert MDX Query Result in Double Type Array List .</DIV>
  <DIV>&nbsp;</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>&nbsp;</DIV>
  <DIV>I wan to Insert this Row # to ArrayList . Can anyone please help me ? 
  </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Regards,</DIV>
  <DIV>Smruti</DIV></BLOCKQUOTE></BODY></HTML>