Consultor Eletrônico



Kbase P92935: Report Builder - How to change the font colors according to a given condition
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/27/2004
Status: Unverified

GOAL:

Report Builder - How to change the font colors in runtime

GOAL:

How to print records using different colors

FIX:

The font color in Report Builder could be changed in the development time, but there is not a property or method to change it at runtime. A workaround to achieve it could be to create multiple band lines with different font colors and then hide or view the correct one.

The following steps are an example of how to do it:

The example will use the sports2000.customer table, in this example the records where the 'Balance' is greater than the 'CreditLimit' will be shown in red.

1- Create a Calculated Field with the name 'overLimit' and add the following expression to it:

IIF(Balance > CreditLimit, TRUE, FALSE)

2- In the 'Record' Band Line add the fields CustNum, Name, Balance and CreditLimit

3- Right button on the same band line and set the following values:

a- Check the 'Enabling Conditional Printing' option
b- Select the 'overLimit' field in the combo-box
c- Select the 'Print When Field Is True' option

4- Create another 'Record' band line and add the same fields in the same column that the band created in the step 2

5- Repeat the following steps for each fields added in the new band line:

a- Right button over the field
b- Choose the 'Font' menu
c- Change the color to 'Red'

6- Repeat the step 3 for the new band line, but now select the 'Print When Field Is False or Unknown' option