Report Writer Page Numbering and Scroll Areas
RW does not have the concept of "Scroll Areas" in the same way as certain Report Applications (such as Remittance Advices). To get around this limitation, you have to write RSL code to simulate these two features.
There are three parts to this:
1. Defining variables as part of the define-record
- I've defined a variable pagenum and linenum for this:define _hci_D record
…,
pagenum integer,
linenum integer
end record
2. Initialising the defined variable
- This is done in the "before first row" section of the report:output _hci_O record
...
before first row
…
_hci_D.pagenum := 1
_hci_D.linenum := 0
every row
3. Outputing the variable's value
For each row in the report, check to see if the value of pagenum is divisible by the number of lines in a page (in the example it is 10) - if so, print the pagenum/page-size.
Also, if it's not the first page, call newpage to print a page-throw before printing the row's data.
on every row
...
if _hci_D.linenum % 10 = 1 or _hci_D.linenum = 1
if _hci_D.pagenum > 0
newpage
end if
print row 1 column 94 (_hci_D.pagenum using "-------&")[0 : 7]
_hci_D.pagenum := _hci_D.pagenum + 1
end if
...
print row 1 column 74 (_hci_D.linenum % 10 using "-------&")[0 : 7]
<The rest of the output>
end output