How To Number Pages And Records
This topic discusses numbering pages and records in reports.
Requirements
- Familiarity using the Report Writer in Collect!
- Understanding of Lists, Loops and Variables
List Count
When you are looping through records in a report, you can insert
the following code at the beginning of your line of data and it will
display the number of the record you are printing. For instance,
if your report displays 10 items in a list, they will be numbered from
1 to 10 by using this control code.
SYNTAX: @n - print the current item number in
a list.
Please note that this is only valid within the body of a loop.
Example:
@cl.de
@n @de.na<30> @de.li @de.ow<12>
@cl.de
This short example loops through a client's debtors, numbering them
as they are displayed. It then prints the total number of Accounts
printed and also a total Owing. Please see How To Use Totals In Reports
and How To Use Loops for additional tips.
Example using a variable:
This example produces the same output using a variable
to increment the counter.
@varNum# = 0
@cl.de
@varNum = @(varNum+1)
@varNum<3> @de.na<30> @de.li<10> @de.ow<12>
@cl.de
Please see How To Use Variables for more information.
Sample Output:
1 | Elliot, Randall | 05/20/2002 | $5,732.70 |
2 | Gonzales, Hernando | 06/10/2002 | $150.30 |
3 | Hirsch, Henry | 04/21/2002 | $2,456.00 |
4 | Kuebler, Dennis | 04/14/2002 | $3,460.00 |
5 | Louis, Theodore | 06/03/2002 | $2,340.00 |
6 | Mayes, John | 05/24/2002 | $1,360.00 |
7 | Nadeau, Pierre | 06/10/2002 | $5,984.53 |
8 | Raab, Tara | 03/03/2002 | $7,094.60 |
9 | Rocca, Rachel | 05/13/2002 | $2,232.87 |
10 | Scott, Sandra R. | 04/25/2002 | $1,560.70 |
11 | Selinas, Christopher | 06/10/2002 | $5,680.00 |
12 | Uhl, Thomas | 06/10/2002 | $780.00 |
13 | Wells, Les | 03/29/2002 | $8,272.04 |
To count records and display a total completely outside
of the loop, you will have to use variables. Please refer to
How To Use Static Variables for more information.
Page Number
This prints the Page Number. You can place it in the report body
wherever you want the number to appear. For instance, upper
left corner, or upper right corner or bottom center.
SYNTAX: @p - Print the current page number.
For running page numbers, put the @p in a Footer.
New Page
There are several ways to force a new page in your report.
Form Feed
SYNTAX: @f - Tells the report writer to do a form feed.
This code inserts a <NEW PAGE> command at its location
in the report body. This forces the report to advance to a new
page before continuing to print.
This is useful to force information to appear on a new
page for each record pulled from the database.
Form Feed At Line Number
SYNTAX: @fxx - do a form feed if the line number
on this page is equal to or greater than xx.
For example, @f65 means form feed after 65 lines on this page.
There must be no space after the @f.
Form Feed With Footer
SYNTAX: @fo - print the footer and eject the page.
This command tells the report writer to print the footer that
was designed for this report through the Footer
button at the top of the Report Definition form.
Page Orientation
When you are viewing the Report Definition form for a specific
report or letter, you can access the Report Options form by
pressing the Options button at the bottom of the Report
Definition form. Please refer to help on Report Options for
details about setting page orientation using the fields in this form.
See Also
- How To Use Loops
- How To Print A List of Records
- How To Use Static Variables
- How To Use Totals In Reports
- Report Topics Index for a list of all report and letter topics
- Report Sample to view sample reports and letters
|
Was this page helpful? Do you have any comments on this document? Can we make it better? If so how may we improve this page.
Please click this link to send us your comments: helpinfo@collect.org