Production Reporting ActiveX Control Function Group

The main form contains an Production Reporting ActiveX Control object, SQRX. The "Production Reporting" menu item contains options for both local and remote functions of the Production Reporting ActiveX Control, which are routed to the embedded object, SQRX.

Local Run and Local Run No Wait both prompt for an SQR or SQT filename, then prompt for the complete Production Reporting ommand line, with the filename as the first parameter. If you click OK, SQRX.LocalRun() or SQRX.LocalRunNoWait() are called with this command line. If successful, Local Run and Remote Run, automatically display the report output in the Viewer window.

The Production Reporting ActiveX Control has a DatabaseName property. Since Production Reporting has versions that run against all the major relational and ODBC compliant database systems, it is possible that you have Production Reporting for Oracle and Production Reporting for ODBC installed on the same machine.Production Reporting distinguishes between them by looking for an environment variable called SQRDIR in the SQR.INI file normally installed in the system directory such as C:\WIN. The SQR.INI file keeps a separate SQRDIR for each supported database in a section like [Environment:Oracle] or [Environment:ODBC].

To invoke the Production Reporting ActiveX Control’s LocalRun or LocalRunNoWait to run an Production Reporting program that is written for Oracle, ensure that Production Reporting for Oracle is called. This is can be done by setting the DatabaseName property to Oracle. In the sample program, "Set Local DatabaseName" allows you to select from one of the supported databases. Note that this is a Visual Basic form (dialog box), not one from the ActiveX Control. The "(common)" entry leaves DatabaseName blank, causing Production Reporting ActiveX Control to use [Environment:Common] section in SQR.INI, which is the same as the latest installed Production Reporting product.

To run Production Reporting Remote, you need to establish a connection to a server by selecting Remote Connect from the menu. You can connect to another server afterward, which automatically disconnects you from the previous server. When the program closes, it disconnects by itself, but you can choose Remote Disconnect if desired.

Once connected, you can run Production Reporting remotely in synchronous mode or in asynchronous mode, using Remote Run and Remote Run No Wait, respectively. These two options are optimized for running Production Reporting. As a result Remote Run allows you to run SQR or SQT programs on remote servers as easily as on local machine.

For RemoteRunNoWait, the control is returned immediately with a temporary filename on the server, which is used in RemoteGetResult to get the result files of the remote run, or RemoteCleanup to delete its related files on the server. The application (in this case, this sample program) should check (repeatedly) if the remote run has finished by calling RemoteGetResult. If the result is FALSE, then it is not yet finished. Once finished, RemoteGetResult retrieves all the output files to the local machine, just like the output from a local call or a synchronous remote run.

In addition to these Production Reporting -specific methods,Production Reporting ActiveX Control also exposes a number of more generic FTP/REXEC operations, grouped under the "More Remote Methods" option, such as RemoteGet (FTP get), RemotePut (FTP put), RemoteExec (REXEC), RemoteExecNoWait, and so on. Some of these operations, such as RemoteGetUniqueSQRFile and RemoteCleanup, support the remote running of Production Reporting.