Albert,
Is the goal to make sure that the last 2 detail lines are always on their own page or is it to make sure there are at least 2 detail lines on a page per grouping?
Either way, You may get it to work using a technique similar to this with VFP 9:
- Add a column to your report cursor that identifies the 3rd from the last record for each group. Lets say "isthirdup"
- Add a dummy, invisible rectangle to your detail band that is the same height as the detail band. Give it some identifying mark so you can find it in the ReportListener. Lets say add a comment "*:stretchy"
- Add code to the AdjustObjectSize of the ReportListener that will identify the 3rd from the bottom record and this new rectangle
- Check the oProp.MaxHeightAvailable against the oProp.Height to determine if you have 3x the space available. If not, set oProp.Height to oProp.MaxHeightAvailable
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
Of course there could be other factors invloved here, but maybe this will give you another approach to try.