Conditional Formatting for Boolean Properties

With these properties, there is either a True or False status. If a field has the Suppress property checked, the property is True, and it will be suppressed. If not, the property is False, and the field is shown. When working with conditional formatting on these types of properties, all we need to do is specify a condition. If that condition is True, then the property will be set to True.

For the following walkthrough of conditional formatting, open the Customer Sales report (customer_sales.rpt) that's included with the sample files for this chapter.

In the case of Suppress, you can right-click a field. In this case, the Last Year's Sales field (not the field in the report header, but the one in the report proper!). Select Format. On the Common property page, you will see the Suppress property checkbox. To start with, don't check the box-that would turn suppression on for every value. Instead, click the X+2 box that appears to the right of the property, as shown in Figure 8-12, to open the Formula Editor, and enter a conditional formatting formula.

Since this is a Boolean-type property, all we need to do is enter a condition. When the condition is True, the formatting option will occur (in this case, the field will be suppressed). The formula would look like this:

{Customer.Last Year's Sales} < 10000

This would cause our report to show only the values that were greater than 10,000.

This conditional formatting formula was applied to an individual field so only the field is suppressed, but you could apply it to an entire section. Be warned, though, that, when you suppress a field or a section, it only suppresses the display of the field. It will still be included in any totals or formulas.

Figure 8-12

Was this article helpful?

0 0

Responses

  • lyle
    How to set format property in crystal reports?
    8 years ago
  • charles
    How to check the boolean supress condition in the crystal report?
    7 years ago
  • Bethany Ross
    How to suppress boolean fields in crystal reports?
    6 years ago

Post a comment