User Tools

Site Tools


query_center_translation_file_cfilterlist_trn_.htm
Navigation:  Templates > Templates by Topic > QBE List and Form Support >====== Query Center Translation File (cFilterList.TRN) ====== Previous pageReturn to chapter overviewNext page

The Query Center Translation File, cFilterList.TRN, is the backbone of the BrowseQBEList control template for standard and ADO based browse procedures. It defines all regular and exception group information for both standard and ADO types of applications.

The format of the expression to be used with the associated operator defines “keyword”. Those keywords are enclosed in square bracket ([]) and will be replaced at runtime by the appropriate value.

Those Keywords are:

[COL]

[VAL]

[V1]

[V2]

[MV]

[MV, Picture]

[APP_PIC]

[PIC, Picture]

Some of these keywords have a direct relation with the BrowseQBE Advanced interface. For example, in the query interface:

QCenter1.jpg

The keyword [COL] will refer to the list column called “Column”. The [VAL] keyword will refer to the list column “Value/Expression”.

When the “Apply” button is pressed, the code executes the following steps.

1.It will loop through all the lines in the Filter list.

2.For each line, the code is doing a lookup in an Exception queue to see of there is an exception handler for the operator and the data type involved. In this case, there is no special handling for that data type so the code will use the entry in the standard group for “Equal”

pstring('Equal')

pstring('[COL] = [VAL]')

3.The internal queue has the information that “Customer ID” corresponds to a column SQL name of Customer.CustomerID. So the code replaces the keyword [COL] by “Customer.CustomerID”. At this point, the filter string will look as:

Customer.CustomerID = [VAL]

4.After that, [VAL] is replaced by the content of “Value/Expression” column of the current filter line that is under process. If there is the need for it, quotations around the value will be added. So the final filter string generated by the code will be:

Customer.CustomerID = 'AROUT'

[V1] and [V2]

These keywords tell the code that content of “Value/Expression” column contains 2 values separated by a comma. Example of operators that involve this format is BETWEEN, NOT BETWEEN as defined in the group:

pstring('Between')

pstring('INRANGE([COL], [V1], [V2])')

[MV]

This keyword means that the content of “Value/Expression” is representing 2 values or more and the code will generate a set. For example, given the following group entry for SQL:

pstring('IN')

pstring('[Col] IN ([MV])')

and using the following values from the application:

QCenter2.jpg

The code will generate the following filter string:

Customers.CustomerID IN ('ALFKI','ANATR','ANTON')

[MV, Picture]

This variant of the [MV] keyword will indicate to the code that the values returned in the set should be formatted using the picture specified. If necessary, the code will deformat the value before applying the needed picture.

For example, the cFilterList.TRN has the following entry in the MSSQLDateTime section:

ulong(datatype:date)

   pstring('IN')

   pstring('CONVERT(char(15), [COL], 111) IN ([MV, @d10])')

If the Value/Expression column contains '21/09.2003, 22/09/2003', the result filter string will be:

    CONVERT(char(15), ColDate, 111) in ('2003/09/21', '2003/09/22')

Specialized keywords

[APP_PIC], [PIC, Picture]

On many occasions, generic processing is not enough and a more specialized processing is needed. A good example for this is date processing. The expression the code will use to build the filter string is using DEFORMAT for date processing and that statement involves a picture (ex: @d10). This is where the [APP_PIC] keyword finds its duty; it supplies to the code a placeholder where that data picture used in the app will be inserted in the expression.

The keyword [PIC, Picture] is always used in pair in the expression with [VAL], [V1] or [V2]. It simply forces the code to format the value using the picture supplied by the second argument of [PIC, Picture]. For example, the following group entries from the MSSQL exception group use that keyword.

ulong(datatype:date)

pstring('Equal')

pstring('CONVERT(char(15), [COL], 111) = [PIC, @d10][VAL]')

This means that if the application is using ADO and the backend is MSSQL, an expression in the Filter list that uses a date and the equal operator will see the generated string as follow:

CONVERT(char(15), Employee.DateHired, 111) = '1994/10/22'

query_center_translation_file_cfilterlist_trn_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1