I found a solution that seems to working for me:
loObj = CREATEOBJECT("reportlistener")
loObj.listenertype = 0
FOR ln = 1 TO Whatever
REPORT FORM MyReport OBJECT loObj NOPAGEEJECT
ENDFOR
loObj = null
This doesn't work if listenertype is 1 (the preview doesn't show up on the last line), but this can easily be workarounded by setting the listener type to 3 and setup up the previewer manually.
>Thanks a lot for the suggestion. I did try to append an empty report, too, but that didn't seem to work right:
>
>- when previewing, it didn't start the previewer - as if the previwer startup was suppressed by the last report being empty. This can be fixed by setting up the previwer manually
>
>- when sending the output to a printer the last report added an empty page at the end of the print job and I couldn't figure out how the get rid of it
>
>>The easiest trick is this ....
>>
>>
>>FOR ln = 1 TO Whatever
>> REPORT FORM MyReport PREVIEW NOPAGEEJECT
>>ENDFOR
>>REPORT FORM MyReport Next 0 PREVIEW
>>
>>
>>Telling it to do the report with the next 0 records is enough to fake it out so it ends the print job.
Martin