Printing a Report (REPPRINT)

REPPRINT is used to output a report or export file and to run a deletion.

You can run REPPRINT and REPSETUP from the command line or from the system menu. For details of running these applications from the command line see Loading from the Command Line

What REPPRINT does

This section is provided to enable users of Report Writer to know what their Report Writer program should look like. It is provided for two related reasons:

  1. At the top of each page various headings are printed under user control containing information about what report is being printed and when, followed by the users heading, followed by headings for the fields of the report. If the report is folded then all the headings for all the field are printed unless fold headers are selected in which case just the headers for the next fold to be printed are printed. For exports any headings are normally omitted, and if included they are printed only on page 1 of the report.

  2. For each record processed a detail line will be printed unless it is a subtotal only report. For the first line of the report all the fields which are listed are printed. On subsequent lines only fields that have changed or which are repeated are printed until a break occurs. Following a break all the fields to the right of the break will be printed even if they have not changed. If the first line of a new page is a detail line all the fields will be printed then too, but if the first line of a page is a break line then the next detail line will be printed normally. If a report is a subtotal only report which has some 'list before break' fields then a detail line will produced before every break.

  3. If the value of a field which is a break field changes than a break line is printed. If there are multiple break fields than a break on any particular level necessarily implies that there is a break on all the subsequent break fields. If several breaks occur at once then as many as possible of them are superimposed. The algorithm used to superimpose is slightly complicated to explain but the basic idea is simple: if the number of records processed since the last break at a particular level is the same as the number of records at a lower break level (that is a break field that is nearer the top of the field list) then the fields for the two break levels are grouped together. In each such case the lowest and highest break levels that have matching record counts are processed together.

  4. Fields are listed on a break line if they are at or to the right of the lowest break in the group being processed and before the break field after the last break field in the group. Fields to the right of this are printed if they are not break fields and are totalled or calculated. Fields to the left are printed if the break line is being printed at the top of the page, or if the last break line was at a lower level and no detail lines hace been printed since (which can only happen in subtotal only reports), but only if they are set to be listed on break alines and also on detail lines.

    Example. Consider the following data. The first three fields are all break fields. All the fields are listed, the break fields are not repeated and all the fields are listed on total line. The numeric field is totalled.

       A B C 1.0
       A B C 1.3
       A B D 1.0
       B A D 2.0
       B A D 1.0
    

    The following output should be produced. Subtotal lines are asterisked.

       A B C 1.0
             1.3
    
           C 2.3 *
    
           D 1.0
                   (Not printed if you suppress one item subtotals)
           D 1.0 * (Not printed if you suppress one item subtotals)
    
       A B   3.3 *
    
       B A D 2.0
             1.0
    
       B A D 3.0
    
             6.3  (This is the grand total and would be printed on the
                   grand totals page only)
    
  5. Treatment of multi occurrence fields.

    If a multi occurrence field is listed but not repeated REPPRINT will superimpose lines like this:

       Name         Customer Address        Unpaid Invoices   Amount
    
       Major        10 Downing St           1000              £ 10
                    London                  1001              £100 SW1
       Major                                                  £110
    
  6. Formulas

    Formulas. When a calculated field is printed on a subtotal line then if it is calculated using any totalled fields then the field is calculated using the total that appears on that line.

  7. Exports

    Exports are not paginated and no spacing lines are printed before or after subtotals. The delimiter is not printed on the last field.

  8. Field Layout

    The width occupied by a field is whichever is the wider of the heading and the width required to display the selected number of occurrences.

    For numeric fields that are right justified (including fields with leading zeros or asterisks) the heading and the field itself are right justified within this width.

    For fields other than numeric fields, and for numeric fields, if left justified output or default format are selected, then both the heading and the data begin immediately following the spacing from the previous field.

Using maps

REPPRINT does all its output using maps created by REPSETUP. It is therefore theoretically possible to tailor the output by editing the maps but most of the maps are reposted every time the report is edited. However the following maps are not altered once they have been posted by REPSETUP.

Map NrDescription
3 Printed before grand total
4 Printed after grand total
6 Printed at bottom of each page except the last - normally blank
7 Printed at top of each page unless -nocopy specified
10 End of report

The other maps are as follows: