To add restrictions to an existing report definition, use the following procedure. In the Report Writer window, select the name of the desired report and click Open to open the Report Definition window. Click the Restrictions button to open the Report Restrictions window. Click New to open the Report Restriction Definition window and define a new report restriction.
Before defining a restriction, it’s a good idea to plan the restriction and write it out completely. Decide which fields, operators, constants and functions you’ll need to express the restriction properly. Some restrictions may require that the steps defined below be performed in a slightly different order.
Enter a name in the Restriction Name field. The name can be up to 79 characters long.
If the restriction you are defining uses a system-defined function, the function must be included in the expression before the field it is applied to. For example, to restrict the Customer Order report so that it lists only customers that ordered more than five items, you could use the following restriction on the Item_Number field:
FREQUENCY (Item_Number) > 5
For a detailed description of each function available for use when defining a restriction, refer to Restriction functions.
From the Report Table drop-down list, select the table containing the field on which you want to restrict the report. Once the appropriate table is selected, select the desired field from the Table Fields drop-down list. Click Add Field to add the selected field to the Restriction Expression.
From the Operators section, select the appropriate operator. It will automatically be added to the Restriction Expression field. These are the same operators described in Operators with the exception that the concatenation operator is not available for use with restrictions.
From the Type drop-down list in the Constants section, select a control type for the constant you are defining. The five supported control types for constants in restriction expressions are integer, currency, string, date, and time. Once you’ve selected the constant’s control type, enter the desired value in the Constant field and click Add Constant.
Review the contents of the Restriction Expression field. If any part of the expression is incorrect, highlight the incorrect value and click Remove. Replace the removed value, if necessary. Once the restriction expression is correct, click OK to save the restriction and close the Report Restrictions window.