Maybe The report created on the fly in this case has a private datasession?
Try to open it in report writer and preview.
>>Hi Nadya,
>>
>>I don't see any problem in your code that could cause that. To be sure I would put SUSPEND right before DODEFAULT() and check that everything is ok.
>
>I tried and it showed only 5 records. However, still whole file is printed. I checked on another form, where I don't create report on the fly. It works just fine in this case, e.g. I use filtered index and only these records are printed. So, I guess, something's wrong with my code, but I don't see, what might be wrong. Why creating report on the fly causes this problem?
>
>Thanks in advance.
>
>
>>>Hi everybody,
>>>
>>>In one of my form I generate report on the fly because this form is used for any file. Here is my code:
>>>
>>>
>>>********************************************************************
>>>* Description.......: TableMaint.PrintM
>>>* Calling Samples...:
>>>* Parameter List....:
>>>* Created by........:
>>>* Modified by.......: Nadya Nosonovsky 06/06/2000 12:51:08 PM
>>>********************************************************************
>>>local lcReportName, lcSafety, lnRecno, lcOrder
>>>lcReportName='Reports\TableMaint'
>>>lcSafety=set('safety')
>>>set safety off
>>>select TableMstr
>>>lnRecno=recno()
>>>lcOrder=order()
>>>create report (m.lcReportName) from alias() column
>>>select TableMstr
>>>if !empty(m.lcOrder)
>>> set order to tag (m.lcOrder)
>>>endif
>>>dodefault()
>>>goto m.lnRecno
>>>if m.lcSafety='ON'
>>> set safety on
>>>endif
>>>
>>>dodefault() invokes Report application, which allows to select destination. There are only 5 records in this file, when the filtered index is used. However, the whole file is printed. Do you see the problem in the above code or it might be a problem in Report application itself (I already asked my colleague to check this)?
>>>
>>>Thanks in advance.
--sb--