The issue with the page header not being printed with the summary information is a bug. If the details fill up the first page and there isn't room to fit the summary band, VFP goes to the next page. Unfortunately, it doesn't bother to print any page header or page footer.
In VFP 8, they didn't exactly fix the bug but they did give us a way to deal with it. There are two new checkboxes that allow us to indicate whether we want the Page Header printed with the summary and whether we want the Page Footer printed with the summary.
But .. I'm guessing that you aren't using VFP 8 and need a work-around for your version!! You have a couple of options, but neither of them are perfect.
Solution #1. Create a data group on Invoice Number. Create a report variable called rlFinished, set it to .f., and set it to reset at each Invoice Number. In the OnExit expression of the Group Footer, enter this:
_VFP.SetVar('rlFinished', .t.)
Add all the summary information to the Page Footer band and set the Print When logic of each field to "rlFinished".
The drawback to this solution is that the space required to print the page footer is reserved for each and every page .. not just the last page. This means you'll get less lines per page on page 1.
Solution #2. Create a Data Group on Invoice Number. Create a report variable that counts the number of lines in the Data Group. Put all your fields in the Group Footer and mark them all as float. At the very top of the group footer put an object with the following expression, mark it as stretch with overflow, and make it the width of the report:
REPLICATE(CHR(13), 99-rnLines)
The "99" represents the maximum number of lines that can fit on a page. The drawback to this option is that you cannot have anything within the detail band stretch or it completely throws this off. The other drawback is that you have to preprocess your data so that you can be sure you never have more than 14 lines in the group!
Like I said .. neither option is great .. but that's why they're called "workarounds"!!
Cathy