Page Footer on printed reports.

lp1972

New Member
Hi there, I am trying to put a piece of text on the bottom of every page of a report I am writing. Is there a quick and easy way of doing it? I am not familiar with calculating the line count of a page, but thought that might be the answer? Any ideas please ? Thanks, Lee.
 
If you open your output stream as "paged" (so with PAGE-SIZE set to a value > 0) you can use the LINE-COUNTER function to determine what line you are on on the current page.

From the on-line help:
Returns the current line number of paged output.
The initial value of LINE-COUNTER is 1. At the completion of each DISPLAY statement, Progress increments LINE-COUNTER by the number of lines that were output in that DISPLAY statement. LINE-COUNTER continues to increase until after at least one line has been printed on a new page.
Line-COUNTER returns a 0 if the output is not paged.
Then you can use the PAGE statement as well to start a new page after you have printed your footer.
 
Even simpler. Use the PAGED option (as JongPau mentioned) in your OUTPUT statement. Then define a FRAME as a HEADER with the PAGE-BOTTOM option enabled. There is no need to perform line counting.

eg:

DEFINE FRAME f-myfooter HEADER
"this is the bottom of page"
WITH PAGE-BOTTOM STREAM-IO WIDTH 80.
OUTPUT TO c:\temp\temp.txt PAGED.
VIEW FRAME f-myfooter.
PUT "This is Page1".
PAGE.
PUT "This is Page2".
OUTPUT CLOSE.

Later,
Gordon
 
Back
Top