When using SFormattedFields in a Form to filter datarecords, e.g. to restrict the number of records in a SScrollTable, and a repord will be opened from the form, with the same restrictions, then the property settings of the SFormattedFields must be emulated with currentForm!Fieldname constructs in the SQL statement, of the Repport.
As many currentForm!Fieldname constructs, as needed, can be inserted into the SQL statement. When filtering by more fields, the WHERE clause can be build, corresponding to the property settings of the SFormattedFields and the STableElement:
Example:
SELECT * FROM books WERE (author LIKE 'currentForm!txt_author%') AND (title LIKE 'currentForm!txt_title%')
The AND corrsponds to the default value of the property UseOrOperator of the STableElement (deaktivated). When this property is activated, it corresponds to the OR operator.
With wildcards, the property FilterOperator of the SFormattedFields can be rebuild:
| FilterOperator | Corresponding SQL Operartion |
|---|---|
| a* | column LIKE 'currentForm!Fieldname%' |
| a*a | column LIKE '%currentForm!Fieldname%' |
| *a | column LIKE '%currentForm!Fieldname' |
So every currentForm!Fieldname corresponds to a filtering SFormattedFields.
Example: When at statement like
column LIKE 'currentForm!Fieldname%'
das field keeps empty, the statement will be translated to the statement
column LIKE '%'
At this case there is nothing to filter for. Has the field the value abc, the statement
colum LIKE 'abc%'
will be generated. This corresponds to the behavior of a SFormattedField with the settings to a*.