message-field Pentaho Report Designer

2.3k views Asked by At

I'm using Pentaho Report Designer 3.9.3 and I'm looking for a way to format the font weight, size, and color of each data type within a message field. My message field is as follows.

USAGE FROM $(MAX_DATE, date, MMMM dd) TO $(MIN_DATE, date, MMMM dd)

Which gives the output: USAGE FROM December 09 TO December 15

I would like to format the message field as follows: USAGE FROM December 09 TO December 15 (with December 09 and December 15 having a red font color in regular text)

I'm not sure how to accomplish that without breaking up message fields and combining them. I'm sure that there is a better way to handle that. Your assistance is appreciated.

1

There are 1 answers

0
Tone On BEST ANSWER

An alternative way to achieve this result is to use a message-field and insert html with font size and style that you desire.

<html>
<body>
<span style="color:#333333"><B>USAGE FROM</B></span>
<B><span style="color:red;font-size:16pt">$(MIN_DATE, date, MMMM d)</B>
<B><span style="color:#333333">TO</span></B> 
<B><span style="color:red;font-size:16pt"> $(MAX_DATE, date, MMMM d)</span></B>
</body>
</html>

Change the "rich-text-type of the message-field to "text/html" and that will give you the desired output.