>I call it after the call to the report as shown in my code snippet. If its is placed before the call to the report how will it detect that I have selected to print the report or not?
You need to place it
inside the report and ask it
after the report.
IOW:
Add a extra, outer, group to your report (one can use a summary but this fails with multicolum reports)
Group on .F. (this will make a single large group around your report)
In
Group Footers on
Exit expression place the
_VFP.SetVar('llPrinted', SYS(2040)="2") code.
After the report you may query
llPrintedFYI:
Exit expression can not hold a statement, only expressions (hence the name), thats why we use
_VFP.SetVar('llPrinted', SYS(2040)="2") instead of
llPrinted = SYS(2040)="2". _VFP.SetVar() returns allways .NULL. so there is no harm to the report.
Update:
it is placed on group footer's on exit, because this is somthing that is printed on reports end. If the user cancels printig via ESC, the report will not be "printed"
Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]