Modifying a join

Once a join has been established, you can modify it at any time if required. To do this:

  1. Double-click the join button to display the Join Options dialog. See the dialog.
  2. If you want an outer join made, check the Outer Join option, then specify the format of the join as required: SQL92 or Use'+'.

    Note: You cannot make outer joins for XML data sources.

  3. Edit the join conditions in the Condition panel according to your requirements.
  4. When done, click OK to accept the changes.

See also Join Options dialog for details about options in the dialog.

Outer Join

There are two kinds of join formats: SQL92 and Use'+'. With conventional joins, records that do not satisfy the join condition are eliminated from the result. An outer join preserves these records in the result and replaces the missing values with nulls. JReport calls the join left (right) outer join if the records in the left (right) side table are preserved. For example, consider the following two tables:

Table 1

Order O# C#
101 001
102 002
103 004

Table 2

Customer C# Name
001 GE
002 IBM
003 DELL

The conventional join of Customer.C# = Order.C# will produce the following result:

JoinResult O# C# Name
101 001 GE
102 002 IBM

The left outer join of Customer.C# = Order.C# will produce the following result:

JoinResult O# C# Name
101 001 GE
102 002 IBM
103 004 <null>

The right outer join of Customer.C# = Order.C# will produce the following result:

JoinResult O# C# Name
101 001 GE
102 002 IBM
<null> 003 DELL

The full outer join of Customer.C# = Order.C# will produce the following result:

JoinResult O# C# Name
101 001 GE
102 002 IBM
<null> 003 DELL
103 004 <null>