How To Number Pages And Records
This topic discusses numbering pages and records in reports.
- Familiarity using the Report Writer in Collect!
- Understanding of Lists, Loops and Variables
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
Please note that this is only valid within the body of a loop.
@n @de.na<30> @de.li @de.ow<12>
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
@varNum = @(varNum+1)
@varNum<3> @de.na<30> @de.li<10> @de.ow<12>
Please see How To Use Variables for more information.
|1||Elliot, Randall|| 05/20/2002||$5,732.70|
|10||Scott, Sandra R.||04/25/2002||$1,560.70|
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.
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.
There are several ways to force a new page in your report.
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.
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.
- 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