<html><body bgcolor="#FFFFFF"><div>Now we are talking! JavaScript in Mondrian schema. I will be the first tester.<br><br>Sent from my iPhone</div><div><br>On May 11, 2011, at 1:50 PM, Julian Hyde <<a href="mailto:jhyde@pentaho.com">jhyde@pentaho.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>
<div><span class="380524418-11052011"><font color="#000080" size="2" face="Lucida Sans">By the way. I've thought for some time that writing a
MemberFormatter is an onerous solution to problems like these. (Write the java
class, compile it, include it in a jar, add it to the schema.xml, rinse and
repeat.) A good feature would be formatters (and other similar plugins) written
in script.</font></span></div>
<div><span class="380524418-11052011"><font color="#000080" size="2" face="Lucida Sans"></font></span> </div>
<div><span class="380524418-11052011"><font color="#000080" size="2" face="Lucida Sans">In the schema file you could write</font></span></div>
<div><span class="380524418-11052011"><font color="#000080" size="2" face="Lucida Sans"></font></span> </div>
<div><span class="380524418-11052011"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="LINE-HEIGHT: 18px; FONT-FAMILY: monospace; FONT-SIZE: 10px" class="Apple-style-span"><<a href="http://mondrian.pentaho.com/documentation/schema.php#XML_Level">Level</a><span class="Apple-converted-space"> </span>column="column"
name="name"></span></span></span></div>
<div><span class="380524418-11052011"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="LINE-HEIGHT: 18px; FONT-FAMILY: monospace; FONT-SIZE: 10px" class="Apple-style-span"> <FormatScript>return
sprintf(member.key, "%0d")</FormatScript></span></span></span></div>
<div><span class="380524418-11052011"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="LINE-HEIGHT: 18px; FONT-FAMILY: monospace; FONT-SIZE: 10px" class="Apple-style-span"></Level></span></span></span><br></div>
<div><span class="380524418-11052011"><font color="#000080" size="2" face="Lucida Sans">and Mondrian would execute the included JavaScript whenever
it needed to format the member.</font></span></div>
<div><span class="380524418-11052011"><font color="#000080" size="2" face="Lucida Sans"></font></span> </div>
<div><span class="380524418-11052011"><font color="#000080" size="2" face="Lucida Sans">It should allow for much more rapid iterative development.
Contributions welcome...</font></span></div>
<div><span class="380524418-11052011"><font color="#000080" size="2" face="Lucida Sans"></font></span> </div>
<div><span class="380524418-11052011"><font color="#000080" size="2" face="Lucida Sans">Julian</font></span></div>
<blockquote style="BORDER-LEFT: #000080 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<div dir="ltr" lang="en-us" class="OutlookMessageHeader" align="left">
<hr tabindex="-1">
<font size="2" face="Tahoma"><b>From:</b> <a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a>
[mailto:mondrian-bounces@pentaho.org] <b>On Behalf Of </b>Luc
Boudreau<br><b>Sent:</b> Wednesday, May 11, 2011 9:47 AM<br><b>To:</b>
Mondrian developer mailing list<br><b>Subject:</b> Re: [Mondrian] Numeric
Member autoformat problem<br></font><br></div>
<div></div>Mehdi,<br><br>Can you copy paste your complete Level element
configuration? Using a MemberFormatter is the way to go. Was there any
exception message thrown by Mondrian telling you it failed to instantiate the
MemberFormatter?<br><br><br><br>
<div class="gmail_quote">On Wed, May 11, 2011 at 6:35 AM, mehdi b <span dir="ltr"><<a href="mailto:mehdi_xinu@yahoo.com"><a href="mailto:mehdi_xinu@yahoo.com">mehdi_xinu@yahoo.com</a></a>></span>
wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">Hi,<br><br>I'm using mondrian 3.2.1. I have a Level
which is integer and it has 8 digits length, its definition is as
follows:<br><Dimention name="TrxDate"><br><Hierarchy
hasAll="true" allMemberName="All"><br><Level name="TrxDate"
column="..."
uniqueMembers="true"/><br></Hierarchy><br></Dimention><br><br>when
I want to use this dimension in query like<br>SELECT
{[Measures].{Trx]} on COLUMNS, {[TrxDate].[20110403]} on ROWS from
[Types]<br><br>I encounter the error that [TrxDate].[20110403] not
found, but when I run the query as<br>SELECT {[Measures].{Trx]} on
COLUMNS, {[TrxDate].[2.0110403E7]} on ROWS from [Types]<br><br>the
query executed successfully. I don't know how Mondrian formatted the
members?<br>I also tried various types on the Level definition in
schema like type="String" or type="Numeric" but the result is as the
same. I also created a "MemberFormatter" and assigned it to the Level
definition in schema, but it is not called.<br><br>I also tried the
query<br>SELECT {[Measures].{Trx]} on COLUMNS, {[TrxDate]} on ROWS
from [Types]<br><br>and then print the result through result.print()
method and it seems that Mondrian load the members as scientific
format.<br><br>I would appreciate any
help!<br><br></td></tr></tbody></table><br>_______________________________________________<br>Mondrian
mailing list<br><a href="mailto:Mondrian@pentaho.org"><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a></a><br><a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank"><a href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a></a><br><br></blockquote></div><br></blockquote>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Mondrian mailing list</span><br><span><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a></span><br><span><a href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a></span><br></div></blockquote></body></html>