Good idea, Mike.
That works to me.
Typically the thing to look for is empty report data, if no data is to be printed, not even the static elements of a report (labels etc) arte printed.
So you can test with a report being driven by whatever active alias and run it with an empty table to simulate the situation with no preview, then add a record to simulat the normal case.
I did a simple report with nothing but a report field control on it in the page header. I put MESSAGEBOX("header field") as the expression.
Running the report with an empty cursor without data does not even trigger that header field to make the messagebox call.
If I add a record via APPEND BLANK, the preview displays and the messagebox is called.
You can call whatever else, eg a function logging the display of the report preview. It tricky, but works. Just let your function return an empty string (RETURN ""), or else you will have a .T. in the report at that field position.
Another thing, that helps detecting the case of report being called with no data: Define a report variable "ReportRun", set Initial Value to messagebox("reportvariable"), leave everything else at default, that means reset value based on Report and Calculation type none.
Now even if calling that report with an empty table or cursor as the active workarea, that report variable is inited.
Again, instead of the messagebox call you can make a log call, at this time logging, if the report was called. In a normal case you now will have two log entries, one from the report variable, when the report is called, and one right afterwards from the report header, when the preview shows.
If you only find one entry, then the report data was most probably empty. You can make the log call from the report variable Initial value expression log more info, eg current workarea ALIAS(), RECCOUNT() and other relevant data for analysis and debugging the problem.
Bye, Olaf.