Detects whether a report is being printed or is in preview mode.
SYS(2040) |
Return Value
Character data type. Returns the current status of the report as follows.
| Value | Description |
|---|---|
|
0 |
There is no active report. |
|
1 |
Report is in Preview Mode |
|
2 |
Report is being sent as output (such as a printer or file). |
Remarks
The SYS(2040) function is useful when you want to control content in a report depending on how it is being viewed. For example, you can print a message such as Confidential or Classified but not display it when the report is in Preview Mode.
Note |
|---|
|
The value returned by SYS(2040) does not provide information about whether there is an active preview window displayed. It provides information about whether the Visual FoxPro Report System is in process of generating output only, not with what happens to those results after they were generated. For example, SYS(2040) returns "0" after you use the command |
Example
The following example displays how SYS(2040) can be used to suppress the _PAGETOTAL system variable when the report is in Preview Mode.
Copy Code | |
|---|---|
"Page: " + TRANS(_PAGENO) + ; IIF( SYS(2040) = "1", "", " of " + TRANS(_PAGETOTAL)) | |
Note
Microsoft Visual FoxPro 9 SP2 Help file, VFPX Edition v1.08