>how can i track if the print button was pressed while previewing a report? I need to know if the report was actualy printed or just previewed.
It depends on what you are asking. If you are saying that after the report done, you need to know whether it was printed or previewed, then do it as follows:
llPrinted = .f.
REPORT FORM MyReport TO PRINTER PROMPT PREVIEW
In the OnExit expression of the Summary band of the report, use the following expression:
_VFP.SetVar('llPrinted', WEXIST('Printing...'))
OTOH, if you are asking whether the user is printing or previewing because you want to supress some things on the printed version or some things on the preview version, use the following expression in the Print When expression of the items you want to conditionally print:
** To only display on the report if PRINTING:
WEXIST('Printing...')
** To only display on the report if PREVIEWING:
NOT WEXIST('Printing...')
Cathy