WHERE Portion Editor

The Where Portion Editor Window allows you to edit the WHERE portions in the JReport catalogs.

A WHERE portion, as the term suggests, is the WHERE clause in a SQL SELECT statement.  In JReport,  we call SQL SELECT statements as queries.   Both queries and WHERE portions are stored in the catalog.  And WHERE portions are saved in the catalog independently (not relate to queries).  When a report is running, JReport will construct the SQL statement based on the query used in the report and may substitute the WHERE clause in the SQL statement if there is a given WHERE portion. 

User can specify a WHERE portion to JReport system before run  ( running) a report, so that he can generate the report on different data.

The WHERE portion can be stored in the catalog in two formats: structure and string.  In the structure format, the groups of condition are stored. The WHERE portion consists of many condition groups and the groups (are) connected by logical operator.  Each group consists of many conditions and the conditions(are) connected by logical operator too;  Each condition consists of the left expression, the relationship operator and the right expression.  In the string format, the text of the WHERE portion is stored.

The WHERE portion editor window is vary (varies) with the formats of WHERE portion.

whereportion1.gif (5684 bytes)

Figure-1 WHERE Portion Editor -- Structure type

whereportion2.gif (5355 bytes)

Figure-2 WHERE Portion Editor -- String type

Name
The name that you will assign to the WHERE portion.
Type
The choice lists the two types of the WHERE portions, Structure and String.  User can select one of the two.(them)
 
Query
Lists all queries in the catalog.  User can select one query to build the WHERE portion.  Because a WHERE portion is based on a query, so user has to select a query in order to create or edit a WHERE portion.
Editing area
The editing area is the place where users will input their WHERE portion.  When editing the string type WHERE portion, a text editor will be shown and user can key in the WHERE clause;  When editing the structure type WHERE portion, a condition editor will be displayed and user can construct the where portion by clicking buttons.
OK
Closes this Where portion editor dialog box and accepts changes.
Check
Checks the validation of the WHERE portion according to the query.  The validation of a WHERE portion is defined as: all the  fields and formulas refered by the WHERE portin are available to the chosen query.  The validation check will also ensure that the WHERE portion can work with the specified query.
Cancel
Closes this Where portion editor dialog box and cancels the changes.
Show SQL
Displays the string of the WHERE portion.
Help
Displays the help.