Open topic with navigation
Question fields store answers that the user enters when the report is run. The contents of a question field remain static throughout the generation of the report and are discarded when the report is complete.
Question fields allow a single report definition to be used to generate similar yet differing reports, depending on the user’s specific needs or preferences. Some examples of data that might be obtained through question fields are
|1.||Select Design > Fields to create.|
You can select the Fields to create function from any of the Design function windows, enabling you to create temporary fields while specifying other report information.
When you select Fields to create, the Temporary Fields list is displayed. If you are creating a new report or adding temporary fields for the first time, the Available Field Types list is also displayed.
|2.||Select Question Fields from the Available Field Types list to display the Question Field Type window.|
|3.||Select the type of the data to be entered in your question field:|
Inherit (See Inherited question fields for details on this data type.)
The Question Field Definition window is displayed. See figure 1.
|4.||Enter data in each field as instructed below.|
As an example, let’s assume we want the user to define a range of order dates that will determine which records will be included in the report. First, we need to define two question fields to prompt the user for the starting and ending dates. (See figure 1.) Then we must define selection criteria based on the user’s responses to these prompts. (See Defining selection criteria.) The prompts that will be displayed to the user at report‑generation time are shown in figure 2.
Enter a name to identify the field. This name must be unique among all temporary fields. It must begin with a letter and the remaining characters can be letters, digits, underscores (_), or dollar signs ($).
Our first question field is called START and our second called END.
Enter a description for the question field. The default description is the field name. This description is used as the default field header when this field is printed and displays when the field is listed in the Print Fields list, Sort Fields list, or the list of available fields.
We described our fields as Starting date and Ending date.
Enter the question that should prompt the user at report generation time. The maximum size is 40 characters. If you want a colon or other punctuation to display, enter it here.
Our prompt is Starting date: for the first field and Ending date: for the second field.
Select Yes if you want the user to be required to enter a value in this field. The default is No.
We’ve entered No because we want the fields to default to today’s date, so no response is necessary.
Enter the display format that should be used if this question field is selected as a field to print.
To display a list of existing formats, select Field functions > List selections. If the field is not a date or time field, a list of global formats from the repository is displayed. If the field is a date or time format, a list of predefined display formats is displayed. You should always use a format from the format list for date and time fields because if you enter your own format, ReportWriter treats the field as a normal decimal field. (See Appendix B: Date and Time Formats for a list of predefined redisplay formats.)
Select the format you want to use. See Modifying temporary fields for important information about modifying a temporary field’s format after it has been selected as a field to print.
We selected MM/DD/YY from the selection list.
Enter the default value, if any, that will be displayed after the prompt when the question is presented to the user. Maximum size is 80 characters.
If the question field type is date, you can specify the default value in the same ways the user can enter input in the field when the report is run. (This default value string is not converted to the expanded date until the report is run.) See If the value is a date… for a list of valid date formats.
We don’t want to display a default until the user presses enter, so we’ll just leave this field blank.
Enter a message that will display on the information line at the bottom of the screen. Maximum size is 80 characters. If you don’t enter a message, the information line will be blank.
We’ll tell the user what information we’re looking for with the messages Enter the starting date for your report and Enter the ending date for your report.
|5.||Complete the additional, data‑type‑specific fields, referring to the details in Detail information for specific question field types.|
|6.||Exit the window to save your new question field definition.|
When you generate your report, ReportWriter creates an input window that contains referenced question fields (selected as a field to print or sort or in a calculation expression, selection criterion, subscript, range, or conditional). The fields are displayed in the window according to your definitions, in the order in which they were created. Each prompt appears on a line by itself, with a field for the user’s response to the right, as shown in figure 2. If all of the questions won’t fit into one input window, ReportWriter creates additional windows.
When report generation begins, these windows are placed on the screen, and the user is prompted to enter data in each field. If the user selects Abandon or Quit from the General menu during input, the input and subsequent report generation are terminated.
Alphanumeric question fields
Enter the length of the question field. If you want to use this value in a selection and you want the comparison to be case sensitive set the length to two characters longer than the desired length, so the user can enclose the value in quotation marks (“ ”).
Just press enter to enter No if you don’t want the data the user enters to be forced into uppercase letters. To force all data to uppercase, enter Yes.
From the displayed selection window, select Left if you want the display of this field to be left‑justified or Center if you want the display to be centered.
Numeric question fields
Enter the length of the question field.
Enter the number of characters to the right of the decimal point. The maximum number of characters after the decimal point is 10. The default number is 0.
If a decimal point is required, select Yes from the selection window. The default is No.
If a negative number is allowed, select Yes from the selection window. The default is No.