<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word"><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18928">
<STYLE>@font-face {
        font-family: SimSun;
}
@font-face {
        font-family: @SimSun;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt
}
LI.MsoNormal {
        MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt
}
DIV.MsoNormal {
        MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-FAMILY: Arial; COLOR: windowtext; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US link=blue vLink=purple>
<DIV><SPAN class=809495615-12062010><FONT color=#000080 size=2 
face="Lucida Sans">Yes, there is a semi-standard way of formatting values to 
include style information. I believe that it started with Micrsoft OLAP 
Services, and for JPivot we adopted the same standard. (Although now when I 
search, most of the examples using this are 
Mondrian-related.)</FONT></SPAN></DIV>
<DIV><SPAN class=809495615-12062010><FONT color=#000080 size=2 
face="Lucida Sans"></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=809495615-12062010><FONT color=#000080 size=2 
face="Lucida Sans">I believe that the leading '|' is the clue that style 
information is present. But the standard is essentially arbitrary, and I don't 
know whats supposed to happen if the formatted value actually starts with a 
'|'.</FONT></SPAN></DIV>
<DIV><SPAN class=809495615-12062010><FONT color=#000080 size=2 
face="Lucida Sans"></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=809495615-12062010><FONT color=#000080 size=2 
face="Lucida Sans">You could start a new standard. It's definitely possible to 
return the style in a different calc member. As long as you document what 
analyzer is expecting.</FONT></SPAN></DIV>
<DIV><SPAN class=809495615-12062010><FONT color=#000080 size=2 
face="Lucida Sans"></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=809495615-12062010><FONT color=#000080 size=2 
face="Lucida Sans">Julian</FONT></SPAN></DIV>
<DIV><SPAN class=809495615-12062010><FONT color=#000080 size=2 
face="Lucida Sans"></FONT></SPAN>&nbsp;</DIV><BR>
<BLOCKQUOTE 
style="BORDER-LEFT: #000080 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px" 
dir=ltr>
  <DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
  <HR tabIndex=-1>
  <FONT size=2 face=Tahoma><B>From:</B> Benny Chow [mailto:bchow@pentaho.com] 
  <BR><B>Sent:</B> Saturday, June 12, 2010 7:41 AM<BR><B>To:</B> Julian 
  Hyde<BR><B>Subject:</B> Conditional Formatting<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV class=Section1>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt">Hi Julian,<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt">I&#8217;m looking into some conditional formatting for 
  Analyzer and I tried out your suggestion in this forum post you 
  made:<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt"><A 
  href="http://forums.pentaho.org/showthread.php?t=47222">http://forums.pentaho.org/showthread.php?t=47222</A><o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt">&lt;CalculatedMember <BR>name="Profit" 
  <BR>dimension="Measures" <BR>formula="[Measures].[Store Sales] - 
  [Measures].[Store Cost]"&gt; <BR>&lt;CalculatedMemberProperty 
  name="FORMAT_STRING" expression=" <BR>Iif([Measures].[Profit] &lt; 100000, 
  '<B><SPAN style="FONT-WEIGHT: bold">|$#,##0.00|style=green</SPAN></B>', 
  '|$#,##0.00|style=red')"/&gt; 
  <BR>&lt;/CalculatedMember&gt;<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt">For the cell that has this member as its context, 
  suppose Profit is 100. &nbsp;Will cell.getFormattedValue return $100.00 or 
  |$100|style=green ?&nbsp; I am currently getting the ladder. &nbsp;If the 
  ladder is correct, is JPivot doing some post processing by parsing the 
  formatted cell value and then showing the $100 in HTML and then applying the 
  other stuff like style=green as a CSS attribute? 
  &nbsp;<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt">Maybe there is some special handshake that&#8217;s going on 
  between Mondrian cell formatting and JPivot that makes the conditional 
  formatting work. &nbsp;<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt">Any insight would be much 
  appreciated.<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt">Thanks<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=3 face="Times New Roman"><SPAN 
  style="FONT-SIZE: 12pt">Benny<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT size=2 face=Arial><SPAN 
  style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p>&nbsp;</o:p></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>