[Mondrian] RE: Conditional Formatting

Julian Hyde jhyde at pentaho.com
Mon Jun 14 18:23:33 EDT 2010

If you feel like throwing the parsing code over the wall to me, I will add
it to mondrian. Maybe add a couple of unit tests too. "The tests are the
specificiation" and all that good stuff.


From: Benny Chow [mailto:bchow at pentaho.com] 
Sent: Monday, June 14, 2010 7:41 AM
To: Julian Hyde
Cc: mondrian at pentaho.org
Subject: RE: Conditional Formatting

I looked at the JPivot source code and indeed it looks for a leading "|".
After that, JPivot splits whatever Mondrian returns from
cell.getFormattedValue using "|" as the separator.  JPivot then applies a
regular expression to find name value pairs separated by a "=".  The name
part corresponds to "style", "link", "arrow" or "image" as described here:
http://jpivot.sourceforge.net/news.html -> Member Properties


I'm going to keep the same standard for Analyzer since it means people can
re-use their JPivot mondrian schemas with Analyzer and keep their cell





From: Julian Hyde [mailto:jhyde at pentaho.com] 
Sent: Sunday, June 13, 2010 12:04 AM
To: Benny Chow
Cc: mondrian at pentaho.org
Subject: RE: Conditional Formatting


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.)


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 '|'.


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






From: Benny Chow [mailto:bchow at pentaho.com] 
Sent: Saturday, June 12, 2010 7:41 AM
To: Julian Hyde
Subject: Conditional Formatting

Hi Julian,


I'm looking into some conditional formatting for Analyzer and I tried out
your suggestion in this forum post you made:





formula="[Measures].[Store Sales] - [Measures].[Store Cost]"> 
<CalculatedMemberProperty name="FORMAT_STRING" expression=" 
Iif([Measures].[Profit] < 100000, '|$#,##0.00|style=green',



For the cell that has this member as its context, suppose Profit is 100.
Will cell.getFormattedValue return $100.00 or |$100|style=green ?  I am
currently getting the ladder.  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


Maybe there is some special handshake that's going on between Mondrian cell
formatting and JPivot that makes the conditional formatting work.  


Any insight would be much appreciated.





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20100614/255ed2ee/attachment.html 

More information about the Mondrian mailing list