Hi,
i try to run a report from a form, the form sourcetable and the report main dataitem are the same. i used Report.Run(...,Rec) in the Command Push trigger. the matter is that the report do not run with the current record of the form but with the random record in the table.
HAve any idea, please share with me.
0
Answers
Reports are run with the filters on rec not the value of rec.
You need to set a filter on rec equal to the primary key values of rec
Use:
myrec local variable same as rec
myrec.setrange(field1,rec.field1);
myrec.setrange(field2,rec.field2);
(etc, if needed)
report.run(....myrec);
Steve
TKs U.
REPORT.RUN function have next sintaxis:
REPORT.RUN(Number [, ReqWindow] [, SystemPrinter] [, Record])
for your report it will be:
REPORT.RUN(90028,TRUE,FALSE,g_changerequest);