Executes the specified Report worksheet and sends the output to hard disk, printer, or PDF.

Function Group Execution Windows Embedded Thin Client Mobile Access
Report Module Activity Synchronous Supported Supported Supported Supported


  Report( "strFunction" , optNumOrientation )  
String specifying the operation to perform and the Report worksheet to output, using the syntax Operation:Report worksheet, where…

Operation is either Disk (saves data file to hard disk), Prn (sends report to default printer), or Pdf (generates a PDF file of the report); and

Report worksheet is the name of the Report worksheet file ( *.rep ) to output.

Set the paper orientation as follows: 0 (default) is Portrait, 1 is Landscape. This parameter is ignored if the Operation is other than Prn.
Note: Some features of this function are not supported when running the project on a Windows Embedded device: it cannot generate PDFs; it cannot change paper orientation using the optNumOrientation parameter; and it does not support Report worksheets in RTF format.

Returned value

Value Description
0 Success
1 strFunction is configured with a numeric value (invalid)
2 strFunction does not contain “:” (invalid)
3 strFunction contains an invalid output type before the “:
4 Background Task is not running (see Tip below)
5 Disk error (e.g., disk full, read-only file cannot be overwritten, or invalid path)
6 Specifed Report worksheet does not exist
Tip: The Background Task must be running in order to execute this function. Otherwise, the operation will not be executed and the function will return the value 4 indicating error. For more information, see Execution Tasks.


Tag Name Expression
  Report( “Disk:Report1.rep” )
  Report( “Prn:Report2.rep”, 0 )
  Report( “Prn:Report3.rep”, 1 )
  Report( “Pdf:Report1.rep” )