Reader small image

You're reading from  Pentaho 5.0 Reporting by Example: Beginner's Guide

Product typeBook
Published inAug 2013
PublisherPackt
ISBN-139781782162247
Edition1st Edition
Tools
Right arrow
Author (1)
Right arrow

Time for action – using functions to configure styles


We will now create a function to obtain the maximum value for sum_amount present in our report. We will then use the said value to obtain its corresponding customer and apply a bold style onto it.

  1. In the Summary category, we will create a new function Maximum and configure the following:

    • Functi on Name = MaxSumAmount

    • Field Name = sum_amount

  2. Now we will select the Message object we placed in the Details section of our report and configure the following:

    • S tyle.bold: =IF([sum_amount]=[MaxSumAmount];"true";"false")

    This formula will analyze row by row if the current value of sum_amount equals MaxSumAmount (the maximum value for sum_amount). If such a condition is true, the name of the customer shall be put in bold, if it is false, it will retain the current style.

    Note

    In later chapters, we will discuss greater detail the definition of formulas.

  3. If we now perform a preview on our report, we will be able to see how the style for the customer...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Pentaho 5.0 Reporting by Example: Beginner's Guide
Published in: Aug 2013Publisher: PacktISBN-13: 9781782162247