[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Passing value from program to Footer.



Yeah I agree.. But I need it in the first page itself. In that condiation 
footer section is triggered before the program execution, so how can I pass the 
selected values to this footer.

Thanx
Siva

>>> PGCLARK@VAC-ACC.GC.CA 08/08/00 06:44PM >>>
Siva,

The technique is exactly as it would be in dynamically altering infomation in 
the header lines i.e. the trick is to remember when the header and footer 
sections are done ... when current row being processed forces a page overflow 
or after triggered programmatically by a new-page command. That means that the 
current row you are processing at that time may or may not contain the value 
you want to report in the header or footer ... in other words, you want to be 
reporting the value of the previous record processed.

e.g.
begin-procedure Main
begin-select
A.Custno
(other fields)

if $first <> 'Y'
    let $first = 'Y'
    let $previous_custno = &A.Custno
else
    if &A.Custno <> $previous_custno
        new-page
        let $previous_custno = &A.Custno
    end-if
end-if

from customer-file A
where whatever
order by Custno
end-select
end-procedure

begin-footer
print 'Customer Number: ' (1,1)
print $previous_custno (0,0)
end-footer

This will ensure that the customer number (or whatever) printed in the footer 
(or header for that matter) is the value before the change in customer number 
caused a page break (if it just a page overflow, the value doesn't change and 
it doesn't matter whether current or previous value reported)

HTH,
Peter

>>> Siva Prasad Juluri <JSIVA@BANGALORE.IMRGLOBAL.COM> 2000/08/07 12:59:01 pm 
>>>>
Hi all,
 Coul some help me in "Passing the value within program to Footer."
In my program I have to dynamically change the Footer value depending upon the 
value I get from the SQL statements.

Thanx a lot

Cheers,
Siva