The Prompt tab allows you to define run-time prompts that are completed by the person running the report. Up to 10 prompt fields are allowed, several types of prompt are definable.
When running the report, these prompts can ask for a range of dates from which to make a selection, the lowest and highest account codes to be included, a particular product group to report on or simply present tick boxes for you to click.
Prompts can request input of text, numbers or dates. Date input is verified to prevent illogical dates being used, i.e. 30/11/99.
The Prompt tab will construct itself based on the application of different prompt types.
What do you want to do?
Although up to ten prompts may be used, it is often better to use as
few as possible. The use of Report Generator is enhanced by the use
of prompts but you will soon get fed up with having to repeatedly
enter prompt values which would be better served by 'hard coding' the
item into the Select tab.
Prompts are, by definition, Derived columns. As such, the names used
must adhere to normal derived field naming conventions. Use
characters in the range A-Z instead of "$£$%^&* type
characters. Remember to add a dollar sign ($) to the end of
the field name if a text value is being used.
To set up a prompt:
Double click in the name column or click the Insert button.
The REPORT PROMPTS form is displayed. Tip :
Enter the required field name in the Name field and press <Tab>,
or click in the Type field. The field name chosen will subsequently
appear on the list of derived fields, so make sur you choose names
which will not clash with existing or planned derived fields.
This column governs the Type of prompt. The column type will
automatically default to 'character' if the prompt name ends with a
dollar sign. Otherwise the column type could be a Numeric field, a
Date field, a Check box or a Radio button.
Numeric: This will allow input of a number. Numeric fields
require a 'pre-post' image instruction. This will illustrate the size
of the number, whether negative numbers are allowed and how many, if
any, decimal places are allowed.
Thus the following examples apply:
-6.2 - allows input of numbers from -999999.99 to 999999.99
6.2 - allows input of numbers from 0 to 999999.99
6.0 - allows input of numbers from 0 to 999999
Date: Date fields are very simple. Type in the letter 'D'
and the system will prompt the user for input of a date in the
format DD/MM/CCYY and verify the date once typed in.
Check box: This is simply a prompt that will accept a 'Yes/No'
decision. If you set the check box to a tick the value of the field
is set to TRUE.
Radio button: Radio buttons can be grouped together. They are
clicked with the mouse to set their value from false to true. The
reason radio buttons are used instead of check boxes is that you
group radio buttons together so that only one in the group can ever
be ticked.
The image for the prompt is quite important. The size of the image
should be large enough for you to enter the required characters but
not too long.
The way the image type is entered depends on the sort of field
type requested.
The prompt text is the final item. This is the question that will
appear on the tab when the report is run, asking you to type in a
value of some sort. Only 30 characters can be used to phrase the
question, therefore it should be phrased in a concise manner,
although clear enough for you to understand. Leave space at the end
to tell you whether blank input is permitted.
A prompt such as:
Enter lowest invoice date
is fine, but you does not know the effect of leaving the prompted
date blank. If a blank input is permitted then consider:
Lowest inv. date (blank=all)
This makes it clear to you that the date is not mandatory.
Tip: Remember to make sure that wherever the prompted value is
being used, that blank or zero records can be catered for. See a
later topic in this on-line help for an example
of this.
Each prompt field, (apart from date fields), can have a prompted
value. This is often useful if there are preferred values, although
an alternative is required from time to time. Tip :
Some prompts are better used if the user is able to search for the
value. A prompt that asks for the lowest and highest Sales Ledger
account codes is all well and good as long as the person running the
report can remember the code.
If you provide a search facility, by way of a drop down menu, or an Ellipsis
button, the correct code can be located and the report is
more accurate.
This option is best explained by use of an example, in this case we
will use an example of allowing a look-up for a Sales Ledger account code.
The first value to be completed is to identify the module. To provide
a lookup table the system will need to know which module to look at.
The company selection is made in a similar way to company selection
in the tables tab. Leave the two asterisks to use the current
company. In some cases lookup tables can only be found in company 00.
Select the table required. The table used does not have to feature
anywhere else within the report.
You now need to identify the key-path you are going to use for the
search. In this case key-path one will be used. This is because the
account code is the required field, and key-path one is indexed by account.
If you want to be able to leave the prompt blank this check box
should be ticked. If it is left blank the report will insist that a
valid account code is entered.
This is the field you will fill in initially to look for the correct
account. It is usual to choose the column you are trying to find. In
this way you can at least complete part of the field to limit the
search. In cases where there are only about 1-10 records in the
lookup file a search will not be needed and the system will simply
provide a drop down box from which to make a selection.
This is the first of the descriptive fields which identify the record
to be chosen.
This is the second description field, allowing you to easily be able
to correctly select the record as a result of the search.
Once prompt fields have been set up, you may use them in a variety of
ways. They can be used in any of the SEQUENCE, FORMAT, DERIVED and
SELECT tabs.
Three examples of prompts will be given.
First, we will imagine that you want to run a report which will
include items dated between two dates that are to be decided at the
time the report is run.
Two date prompts are set up, DATEA and DATEB. DATEA
asks for the lowest date to be included, and DATEB asks for
the highest date.
Once defined you must then include these two fields in the SELECT tab.
The two lines of selection will look like this;
!1_INVDATE >= !0_DATEA OR !0_DATEA = 0
!1_INVDATE <= !0_DATEB OR !0_DATEB = 0
The first part of the line will check to see if the prompted date is
greater than, or equal to, the date on the record being examined. It
goes on to the second part of the line, (!0_DATEA = 0), to
allow inclusion if the prompt field has a value of zero.
The reason for this second statement is to allow all records to be
selected without having to answer the prompt.
On some standard AUTOLINE reports with prompts you will see messages
like, "Enter lowest date (or blank)". If nothing is
entered (blank), then the selection is considered as being not
required. In this case the selection rules need to be able to cope
with a zero value.
As a date field is stored, and considered as, a numeric field, then a
blank input would result in the value of the prompt field being zero
if no input is made. An alpha field would need to check for an empty
space as follows:
!1_EXEC = !0_SALESMAN OR !0_SALESMAN = " "
A second example of prompts is to include one in a derived field calculation.
Imagine a situation where you want to apply an extra level of
commission if a salesman was able to beat a target sales figure. Just
to make it hard for the salesmen we want to be able to adjust the
target, and also adjust the commission level.
To solve the problem we need to be able to use PROMPTS and TERNARIES.
Two prompts will be required:
Setting up Prompts
The Reports prompt form
This button is called an Ellipsis . It provides a search facility.
Click on the button to search for the information that you require.
Name
Type
Image
Prompt text
Default Value
Setting up lookups
This button is called an Ellipsis . It provides a search facility.
Click on the button to search for the information that you require.
Module
Company
Table
Key-path
Blank allowed
Search prompt
Search description 1
Search description 2
Use Of Prompts
Example 1
Example 2:
|
Name |
Image |
Prompt |
|
TARGET |
-5.2 |
Enter new target figure |
|
CNEW |
-2.2 |
Enter new commission level |
The derived field calculations would then look like this:
|
Name. |
= ... |
|
CLEVEL |
(!0_TARGET<!1_SALES? !0_CNEW:!1_COMM) |
|
CCALC |
!1_SALES * !0_CLEVEL/100 |
The first derived field checks to see if the actual sales value is bigger than the targeted figure. If it is then the derived field CLEVEL is set to the new prompted commission level, otherwise the existing commission level in the database is set.
The second derived field, CCALC, then takes the value and works out the commission.
The third example of the use of prompts is in conjunction with the Sequence tab.
Here we will assume you are working on a Sales Ledger database. What you require is a means of listing out a selection of accounts, but only if they fall within a range of prompted account numbers.
While the use of prompts to do this is simple enough, you have the added advantage that the database has at least one KEYPATH which is in account number order.
Because you can scan the database in account number order by using the correct key-path sequence, you can utilise the prompts to speed up the report. What we do is to put the prompt fields into the Start and Finish fields in the Sequence tab.
Once this is done then the Report Generator will start the scan of the database at the lowest value you input, and stop as soon as the value of the highest prompt has been reached.
If the prompts are answered with no input at all, then the start and finish fields will become null and the whole of the table will be searched. In this way the prompt fields will not have to be included in the Select tab. Only use prompts in this manner when the information being prompted for matches the key-path being used.