The Prompt tab allows you to define (or create) a selection of prompts to be applied at the point of running the report. Prompts (which can be selection boxes) can, for example, ask for a range of dates, the lowest and highest account codes to be included or a particular product group, and so on.
Any prompts that are completed prior to running a report into batch are saved and used each time. Select Batched reports from the REPORT GENERATOR menu to change them.
Tip: Although up to ten prompts may be used, it is often better to use as few as possible. The Report Generator application 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.
To set up a prompt:
The REPORT PROMPTS form is displayed.
What do you want to do?
Prompts are in fact derived columns therefore 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. Name: 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. Type: 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 can be one of the following: Numeric: Enables input of a number. Numeric fields
require a 'pre-post' image instruction to illustrate the size
of the number, whether negative numbers are allowed and how many, if
any, decimal places are allowed. For example:
-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. Image: 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. Tip: The way the image type is entered depends on the sort of field
type requested. Prompt text: 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. For example:
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. Default Value: 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. Search / LookupReport Prompts Form
Some prompts are better if the user is able to search for the value rather than having to remember say, the lowest and highest Sales Ledger account codes. By providing a search facility, such as a drop down menu or an ellipsis button, 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.
Module: 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.
Company: 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.
Table: Select the table required. The table used does not have to feature anywhere else within the report.
Key-path: You now need to identify the key-path you are going to use for the search. In this case key-path one is used. This is because the account code is the required field, and key-path one is indexed by account.
Blank allowed: 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.
Search prompt: 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.
Search description 1: This is the first of the descriptive fields which identify the record to be chosen.
Search description 2: 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.
If you want to run a report that includes 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 look like this;
The first part of the line checks 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:
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 are required:
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 arecome null and the whole of the table is 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.