Sometimes you want the user to be able to filter on something that is not a field in a table. This recipe will show you how to add a filter to the request form for such a purpose.
Create a report by following the Using the Report Generation Wizard recipe.
Add the following global variable:
Name
Type
Length
CustomerNoFilter
Code
250
Click on View | Request Form (Alt + V, Q).
Add a textbox with a label for the Request Form.
Set the following property on the textbox control:
Property
Value
SourceExpr
CustomerNoFilter
Set the following property on the label control:
Property
Value
Caption
Customer No. Filter
Your request form should look like the following screenshot:
Add the following code to the
OnPreDataItem
trigger for the customer data item:IF CustomerNoFilter <> '' THEN SETFILTER("No.", '%1', CustomerNoFilter);