PDA

View Full Version : Re : Re : Re : [Mondrian]



michael bienstein
01-24-2007, 05:41 AM
Put a CellFormatter on it and test it again:

public class TestCF implements mondrian.olap.CellFormatter {
public String formatCell(Object val) {
return val == null ? "null" : val.getClass().toString()+"@"+System.identityHashCode(val);
}
}

Then use it in the schema (I don't think it works on a per-query basis):
A cell formatter modifies the behavior of

Cell.getFormattedValue(). The class must implement the mondrian.olap.CellFormatter interface, and is specified like this:



<Measure name="name" formatter="com.acme.MyCellFormatter"/>

Michael
----- Message d'origine ----
De : John V. Sichi <jsichi (AT) gmail (DOT) com>

John V. Sichi
01-25-2007, 02:33 AM
michael bienstein wrote:
> Put a CellFormatter on it and test it again:
>
> public class TestCF implements mondrian.olap.CellFormatter {
> public String formatCell(Object val) {
> return val == null ? "null" :
> val.getClass().toString()+"@"+System.identityHashCode(val);
> }
> }
>
> Then use it in the schema (I don't think it works on a per-query basis):
>
> A cell formatter modifies the behavior of | Cell.getFormattedValue()
> <http://mondrian.pentaho.com/api/mondrian/olap/Cell.html#getFormattedValue%28%29>|.
> The class must implement the| mondrian.olap.CellFormatter
> <http://mondrian.pentaho.com/api/mondrian/olap/CellFormatter.html>|
> interface, and is specified like this:
>
> |<Measure
> <http://mondrian.pentaho.com/documentation/schema.php#XML_Measure>
> name="name" formatter="com.acme.MyCellFormatter"/>|
>
>
> Michael

In the schema definition, I don't see any place to specify a formatter
for a calculated member on a virtual cube? You can specify a
format_string, but not a formatter.

JVS
_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian