Kbase P13824: RB: how to print the footer just in the last page
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  30/10/2003 |
|
Status: Verified
GOAL:
How to print the footer just in the last page of the report.
GOAL:
How to print a page footer only in the last page of a Report Builder report.
FIX:
1)In your report you have to create two calculated fields
For example, footertest where the expression must be :
IIF(RECORD-NUMBER()= NUMERIC(RUNTIME-PARAMETER("FetchedRecords")), "Last", "NotLast")
where FetchedRecords is a variable past to report engine using the
RB-OTHER-PARAMETERS.
and Footer where the expression must be :
IIF(footertest = "Last","PRINT THIS","")
PRINT THIS is the string we supposed you want to print.
2)In the Page footer group, insert this calculated field (Footer).
3)To initialize the "FetchedRecords" value you have to counts the records that will be fetched by by Report Builder through 4GL.
This is the value which must be pasted to RB Engine as FetchedRecords variable by typing (let Records be the variable in which is stored the numbers of records fetched by the 4GL filter).
Here is a sample (the filter is cust-num <= 80) of the 4GL procedure:
DEFINE VARIABLE Records AS INTEGER INITIAL 0 NO-UNDO.
FOR EACH sports.customer WHERE (customer.cust-num <= 80):
Records = Records + 1.
END.
run aderb/_prntrb2.p ("E:\dlc91dwrk\test\RB\FooterLast.PRL",
"Customer", /* rb-report-name */
"sports=-db E:\dlc91dwrk\test\sports -1 -RO", /* rb-db-connection */
"O", /* rb-include-records */
"(cust-num <= 80 )", /* rb-filter */
"", /* rb-memo-file */
"D", /* RB-PRINT-DESTINATION */
"", /* RB-PRINTER-NAME */
"", /* RB-PRINTER-PORT */
"", /* rb-output-file */
1, /* rb-number-copies */
0, /* rb-begin-page */
999, /* rb-end-page */
FALSE, /* rb-test-pattern */
"Customer", /* rb-window-title */
TRUE, /* rb-display-errors */
FALSE, /* rb-display-status */
TRUE, /* rb-no-wait */
"FetchedRecords = " + string(Records), /* rb-other-parameters */
"status.txt"). /* rb-status-file */