By 'corp' do you mean 'body'? Let us assume that you do. Let us also assume that you want the footer only at the end of the report not each page.
You want to produce a report in the following format
header line
body line
body line
:
body line
header line
body line
body line
:
body line
footer
Code a variable to hold your header. If you have to have such things as run date and page number then make that variable a structure.
Code a variable for your body line - this is most likely a structure
Code a variable for your footer. Again make it a structure if it is to hold variable data e.g. number of body lines written
Declare a variable to hold the number of lines to be printed per page
Declare a variable to hold a count of lines written so far - initialise it to a value greater than the number of lines per page
Your process is:
at startup:
fill in header details
write header
set lines printed to 1 (or however heading lines there are)
When printing a record:
print the record
increment the lines printed count
if greater than lines allowed per page
write header
set line count back to 1
at end of input update counts in footer and write the footer variable.
That is a simple process suitable for beginners. Later you will coe across more cmplex header, body lines and end of report lines.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic