> I'm still not sure how it works, but thank you, your suggestions worked perfectly. Maybe when you have a moement you can explain it if you like. Thanks again for taking the time.
>
>Carmen
I'd be happy to try to explain it.
First, I had you create a report variable called rlLastPage and set the value to .f. As every detail band was processed, the report writer just reset this value to .f. again. Thus, it never really changed while processing all the detail bands.
Next, I had you create a Data Group with .t. as the expression. What this did was "wrap" the entire report in a Data Group. The expression, which is .t., is evaluated before printing each and every detail band. Because you hard-coded the expression to a constant value of ".t.", it never changed. This means the Data Group header was triggered once at the very beginning of the report and the Data Group footer was triggered once at the very end of the report when it was done with all the detail bands.
Next, I had you use the following in the OnExit expression of the Data Group's Footer.
_VFP.SetVar('rlLastPage', .t.)
What this does is set the value of rlLastPage to .t. when the Data Group Footer is processed. As I just described about, the Data Group Footer gets triggered one final time after all the detail bands are processed. So in essence, you know you are done with the details so set this value to .t.
The final step I had you do is change your print when logic to "rlLastPage" in the Page Footer. Throughout most of the report, this value is set to .f. so these items never print. Once all the detail bands are done, and the Data Group Footer is triggered, this variable gets set to .t. This Data Group Footer is processed BEFORE the Page Footer so when you get down to the Page Footer, the value is now .t. on the final page.
I hope this clarifies!!
Cathy