Thanks for the comments and the links....I will look into them.
My client basically had me implement some "orphan/widow" protection for a printout of "payments". That is, for a multiple page printout, they did not want 1 line left on the very last page of the printout. What I did under VFP7 was to hack the .frx and figure out the header height (which could grow and so I had to take that into account) and the footer height, then figure out how many lines of detail were going to print on each page. I would then run through the data and figure out where the last detail line would print (I had to "run through it" as they also had me implement a blank line every 5 payments). If the last detail line was slated to print on the first row of the last page, I then inserted enough blank lines on the previous page ahead of the 2nd last payment to "bump" the 2nd last payment to the last page so that it printed along with the last payment. It was a lot of work but actually did work in VFP7.
But it does not work at all in VFP9. Somehow my line numbering is always off a bit even though the .frx still gives back the same figures for header height and detail band height etc.
So someone suggested implementing a report listener. Below is the code that he suggested. I have one question (he has not been on-line since), do you know what oProp below refers to? I have actually not tried filling in the AdjustObjectSize() method yet as I was still working on just getting the report to print as it used to be.
DEFINE CLASS MyRL AS ReportListener
nStretchRect = 0
...
FUNCTION BeforeReport
SET DATASESSION TO (This.FRXDataSession)
SELECT frx
LOCATE FOR "*:stretchy" $ comment
IF FOUND()
This.nStretchRect = RECNO()
ENDIF
SET DATASESSION TO (This.CurrentDataSession)
ENDFUNC
FUNCTION AdjustObjectSize(nFRXRecNo, oProp)
IF nFRXRecNo = This.nStretchRect AND isthirdup
IF oProp.Height*3 < oProp.MaxHeightAvailable
oProp.Height = oProp.MaxHeightAvailable
oProp.Reload = .T.
ENDIF
ENDIF
ENDFUNC
ENDDEFINE