A script-enabled browser is required for this page to function properly.

<condition> XML tag

The <condition> tag defines the conditions under which a formatting exception is applied to a field. The <condition>tag must be nested within an <exception> tag.

Syntax

<condition
  source="source_column_name"
  operator="eq | lt | lteq | neq | gt | gteq 
    | btw | notBtw | like | notLike | null | notNull"
  [operand1="comparison_value"]
  [operand2="comparison_value"]
  [relation="and | or"]
/>

Parameters /Options

Description

source

Is the name of the source column to be used in the condition.

operator

Is the operator to use in comparing other values to the source column. The valid operators are:

  • eq (equal)

  • lt (less than)

  • lteq (less than or equal)

  • neq (not equal)

  • gt (greater than)

  • gteq (greater than or equal)

  • btw (between)

  • notBtw (not between)

  • like

  • notLike

  • null

  • notNull

operand1

Is the value to which the source column is being compared. If the operator is null or notNull, then no operands are required. If the operator is btw or notBtw, then you must also specify operand2.

operand2

Is the second value to which the source column is being compared. You only need to use operand2 if the operator requires two values for comparison (that is, if the operator is btw or notBtw)

relation

Defines whether there are multiple conditions and, if there are, how they should be related.

Usage notes

Example

Conditional formatting

The following example shows two formatting exceptions for field f_ename. The first exception changes the text color to red if both of its conditions are met. The second exception changes the text color to blue if its condition is met.

<field name="f_ename" source="ename" 
  label="Employee" textColor="green">  
  <exception textColor="red">  
    <condition source="deptno" operator="btw" 
      operand1="20" 
      operand2="30" relation="and"/>  
    <condition source="sal" operator="gt" 
      operand1="1000"/>  
  </exception>  
  <exception textColor="blue">  
    <condition source="deptno" operator="eq" 
      operand1="30"/>  
  </exception>
</field>

See also

About XML in reports