Chapter 11
(continued)
The askSam Report Writer
Including Field Totals In A Report
askSam allows you to calculate the total of one or more fields in a report. It is also possible to calculate subtotals, but this will be discussed in the Grouping Fields section.
To Place a Field and a Field Total in a Report:
1. Place the field you want to total in the report.
2. Click on the button that appears after the field.
The Insert Field Dialog Box will appear.
3. Choose the “Total Field” setting.
The Total Dialog Box will appear:

4. Set the options in the Total Dialog Box and choose OK.
A plus symbol will appear after the field name indicating that this field will be totaled when the report is run.
When you run the report, the field is output for each Document and a total appears at the bottom of the report.
Example Report with Total command:

Outputs:

NOTES:
1. If you want numbers to be right aligned on aligned on the decimal place, set the field you are totaling on a decimal tab or a right aligned tab.
2. The Total command has 3 modifiers that you set in the Total Dialog Box.
· Numeric Format
· Decimal Places
· Character Style
The “Numeric Format” modifier affects the way the totals are formatted:
MODIFIER DESCRIPTION EXAMPLE
NUMBERS ONLY Outputs a total without commas or 10000.00
currency symbol.
NUMBERS W/ THOUSANDS Outputs a total with a thousands 10,000.00
SEPARATOR separator.
CURRENCY SYMBOL AND Outputs a total with a thousands $10,000.00
THOUSANDS SEPARATOR separator and currency symbol.
The “Decimal Places” modifier defines how many decimal places will be output after a number. You can choose from 0 to 9.
The “Character Style” modifier lets you select a character style for the total. When the report is output, the total will be formatted using this style.
Using the Show Command in Reports
The Show command enables you to output text in a report even if the text you wish to output is not contained in a field. With the Show command it is possible to output sentences, lines, or paragraphs which contain specific words or phrases. For example, you could search through the entire testimony of the Iran-Contra hearings and output every line containing the phrase "Oliver North".
1. Position the cursor where you want the Show command inserted in your report.
2. Choose REPORT -> SHOW
The Show Dialog Box will appear.

3. Enter the Word or Phrase you wish to locate (or you can enter a prompt - see Note 1 for details).
4. Enter a number in the quantity field.
This determines how many words, sentences, lines or paragraphs are output.
5. Choose Words, Sentences, Lines, or Paragraphs.
6. Choose a direction (Before, After, On Either Side Of, or Containing).
This selection defines how much text is output.
7. Set any other options you require in the Show Dialog Box. These options are described in the chapter on Searching.
8. Choose OK
The Show command is inserted in your report. In the Report Editor you'll see:

NOTES:
1. Instead of entering a word or phrase, you can have the Show command prompt you to enter a word or phrase. There are two types of prompts you can use with the Show command.
The "Use Last Prompt from Selection Criteria" option takes the prompt from the Search part of the report and uses it as the word or phrase in the Show command. This lets you select documents containing a specific word or phrase and just output the text around that word or phrase.
The "Prompt" option prompts the user to enter a word or phrase for the Show command. The text entered in the prompt also determines which Documents are output in the report.
2. The "Wrap Output" option in the Show dialog determines how the text will be wrapped. By default, the text will wrap at the margins. You can also define a column in which the text will wrap.
3. The "First Structure of each Document" option outputs the first Word, Sentence, Line, or Paragraph from your Documents.
4. The SHOW report in the SAMPLE_REPORTS.ASK file provides an example of using the Show command in a report.
Counting Selected Documents
The Count Documents command counts the number of Documents selected by a request. When you include Count in a report, the fields in your report are output and following them the Count Documents command outputs the number of Documents selected by the report. Count is very useful in combination with the Group function (described below). You will find more comprehensive examples of the Count Documents command included with the Group function.
To Count the Number of Documents Selected in a Report:
1. From the Report Editor, place fields in your report.
2. Choose REPORT -> REPORT/GROUP FOOTERS.
The “Group Selection” Dialog Box will appear.
3. Click on Report Footer and choose OK.
The Report Footer window will open. We'll insert the Count command in the Report Footer.
4. Position the cursor in the Report Footer window where you want the Count command inserted.
5. Choose REPORT -> COUNT DOCUMENTS
The Count Documents command is inserted in your report.
Example:
The Report Layout

will output:

NOTE:
1. The “Count” report in the SAMPLE_REPORTS.ASK file uses the Count Documents command. Other reports in this file use the Count Documents command in conjunction with grouping. See the section on Grouping for details.
Numbering Documents in a Report
The Number Documents command numbers Documents, as they are output in a report.
To Number Documents in a Report:
1. From the Report Editor, place fields in your report.
2. Position the cursor where you want the counter for each Document to be inserted.
3. Choose REPORT -> NUMBER DOCUMENTS (or type ^i)
The Numbers Documents command (^i) is inserted in your report.
Example:
The Report Layout

will output:

NOTE:
1. The “Numbered List” report in the SAMPLE_REPORTS.ASK file uses the Number Documents command.
|