Using the Production Reporting ActiveX Control Remote

The Production Reporting Remote methods allow an application to connect to a server, submit and run Production Reporting programs remotely, receive the report output, and/or transfer files.

Production Reporting Remote is very useful for running long Production Reporting programs that contain large amounts of data.Production Reporting Remote benefits include:

Table 3. Production Reporting Remote Methods 

Method TypeMethods

Connection/Global methods

RemoteConnect (Method)

RemoteDisconnect (Method)

RemoteIsConnected (Method)

RemoteCancel (Method)

RemoteSetDebug (Method)

RemoteGetShellType (Method)

RemoteGetServerType (Method)

Running Production Reporting Program methods

RemoteRun (Method)

RemoteRunNoWait (Method)

RemoteGetResults (Method)

FTP/REXEC methods

RemoteExec (Method)

RemoteExecNoWait (Method)

RemotePut (Method)

RemoteGet (Method)

RemoteDeleteFile (Method)

RemoteCheckFile (Method)

RemoteGetUniqueSqrFile (Method)

RemoteGetUniqueSqtFile (Method)

RemoteCleanup (Method)

*  To use Production Reporting Remote:

  1. Use RemoteConnect to open a connection to the server.

  2. Use other Production Reporting Remote methods as needed.

  3. Use RemoteDisconnect to close the connection.

The following Visual Basic example opens a connection to the server, runs the Production Reporting program REPORT.SQR on the server, and closes the connection.

Sqr0cx.RemoteConnect("sun4, "myuser", "mypassword", " ")
Sqr0cx.RemoteRun("report.sqr acctg/acctg")
Sqr0cx.RemoteDisconnect

The next example opens a connection to the server, transfers the Production Reporting program to the server, removes any ERR file, runs the Production Reporting program on the server, checks for an ERR file, gets the SPF output file, and closes the connection.

' connect to server
Sqr0cx.RemoteConnect("boston", "reports", " ", " ")
' transfer Production Reporting program to server
Sqr0cx.RemotePut("sales.sqr", "sales.sqr", False)
' remove any error file
Sqr0cx.RemoteDeleteFile("sales.err")
' run report on server
Sqr0cx.RemoteExec("sqr sales.sqr tutorial/secret -e
-nolis", "output.txt")
' check if errors file exists, if does error occurred.
If Sqr0cx.RemoteCheckFile("sales.err") Then
' there’s an error file...
' get output SPF file
If Sqr0cx.RemoteGet("sales.spf", "sales.spf", True)
' disconnect and close
Sqr0cx.RemoteDisconnect

Note:

SQR Production Reporting Activator only supports a single concurrent remote connection.