Copyright: 0.91 (preview version)


TQIFilterDialog component

Acts as an editor for the Filters property of the TQueryInfo component.

Builds the information for an SQL "WHERE" clause via one or more user-orientated sentences with popup lists and edit boxes, linked by "AND" or "OR" ("WHERE" in first line).

A field is selected from list obtained from all fields defined in QueryInfo where FieldUsage contains the uaFilter attribute, using the defined UserName.

An operator is selected from a combo box listing those appropriate to the field type chosen.

Values are entered via the editor, manually or by clicking on the lookup button to retrieve existing values.

The criteria can be negated ("NOT") via the “not” check box.

The line can be nested with another with parenthesis - necessary with two lines linked by "OR" in a complex filter (double-click on line number or via context menu) - click on the nesting button, then on the other line to nest with. Clear a nesting by clicking on a nested line after clicking on the nesting button.

Lines can be moved up/down and deleted (drag line number with mouse or via move buttons).

Right-click a line to bring up the context menu.

The dialog will not close while any partially defined filter lines exist.

properties

Caption, MaxItems, MaxValues, ModalResult, SortFields, QueryInfo

methods

Execute

events

OnOrdering, OnValidateValue

files

qiFilter.dcu/dfm	unit & form resource

qiFrLine.dcu	sub-unit

qiFrLkup.dcu/dfm	values lookup unit & form resource (also used by TQIFilterBuilder)

qiFilter.hlp	hypertext help reference (this file)


Execute method

Shows the dialog modaly. Returns True if OK button pressed (mrOK).

declaration

function Execute: Boolean


Caption property

Appears as the dialog’s caption.

type

string

stage

design time 	run time

access

read 	write


MaxValues property

Limits the maximum number of values that can be included in a SQL “IN” clause filter line. Default = 25.

type

Integer

stage

design time 	run time

access

read 	write


SortFields property

Specifies if Borland-style bitmaps are shown on the dialog buttons.

type

Boolean

stage

design time	run time

access

read 	write


QueryInfo property

References the TQueryInfo component to use on execution (must be assigned before Execute is called).

type

TQueryInfo

stage

design time 	run time

access

read 	write


MaxItems property

Specifies the maximum number of filter lines that the user can use (default = 8).

type

Integer

stage

design time 	run time

access

read 	write


ModalResult property

Stores the modal result of the dialog Execute call.

type

TModalResult

stage

run time only

access

read only


OnOrdering event
OnOrdering property

If assigned, a “Order By…” button appears in the dialog, which calls this event when clicked. Use to execute a field ordering dialog.

type

TNotifyEvent

stage

design time 	run time

access

read 	write


OnValidateValue event

Allows custom validation of field values that the user attempts to use in filtering. To prevent the value from being used, set Valid to False (In this case an appropriate error message should be shown).

type

TValidateFilterValueEvent = procedure(Filter: TFieldFilter; Value: string; var Valid: Boolean) of object;

stage

design time 	run time

access

read 	write