[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] set-delay-print command and Page X of Y
Hi Jyotsna,
The problem is related to the order in which the page is built.
First SQR builds the body, then when the pages fills up or a new-page
command is explicitly issued, it executes the header, then the footer. In
your case, you issue the set-delay-print command in the before procedure, so
it will be executed before anything else - thus the error - no print command
has been issued with a delay - that will happen later when you execute the
header.
You can put the set-delay and print delay wherever you like, just as long as
you execute the set-delay-print AFTER the print xxx delay
This code works (I used the sqr sample tables so you can try it out)
Cheers, Steve.
begin-program
begin-select
a.appointment (1,1) on-break print=always before=before_appt
after=after_appt
next-listing
from appts a, appts b
order by a.appointment
end-select
end-program
begin-procedure before_appt
move 0 to #this-page !reset the page count for each new appointment
print ' new appointment type' (1,1)
next-listing
end-procedure
begin-procedure after_appt
new-page !close off the page - will cause the header to execute
set-delay-print #total-pages with #this-page !now go back and fill in the
! ! page number of the last
page
end-procedure
begin-heading 3
add 1 to #this-page
print 'page ' (1,1)
print #this-page ()
print 'of ' ()
print #total-pages (,,6) delay
end-heading
-----Original Message-----
From: sqr-users-admin@sqrug.org [mailto:sqr-users-admin@sqrug.org]On
Behalf Of Jyotsna Nekkanti
Sent: Wednesday, 12 November 2003 6:11 AM
To: sqr-users@sqrug.org
Subject: [sqr-users] set-delay-print command and Page X of Y
Should set-delay-print command be only used in "after procedure" of the
on-break command?
I tried using it in the before procedure command and it says that the PRINT
DELAY statement did not have a SET-DELAY-PRINT command executed against it.
I am trying to print Page X of Y on the header. I need it to reset with the
change in the purchase requisition number.
For that I have
!***************************************************************************
**
!main
!***************************************************************************
**
begin-select
pr.prnum &prnum1 () on-break print=never
before=page_count
.
.
.
!***************************************************************************
**
! procedure page_count
!***************************************************************************
**
begin-procedure page_count
move #page-count to $last_page 8888
new-page
set-delay-print $last_page with $last_page
move 1 to #page-count
end-procedure
!***************************************************************************
**
! print heading on each page.
!***************************************************************************
**
begin-heading 4
.
.
.
print $last_page (,#Pagepos4,4) delay
.
.
end-heading
If I use "after" instead of "before", I get Page X of Y but in addition to
that it prints the Y part in the body of the report as well. And if i scan
through each and every page of the report, the Y part mysteriously
disappears from the body of the report. But I am sure the users wouldnt want
to go through each and everypage before printing the report.
Please help..
Thanks.
---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users