Using the Production Reporting ActiveX Control Local

The Production Reporting ActiveX Control runsProduction Reporting programs locally on a client machine and remotely on a server machine. An example of a server machine could be your database server using Production Reporting.

To use the Production Reporting ActiveX Control Local to run Production Reporting programs locally on your PC, make a call to the LocalRun or LocalRunNoWait methods of the ActiveX Control instance. These methods take one argument: the Production Reporting command line. The Production Reporting command line includes the name of the Production Reporting program to execute along with database connectivity and other Production Reporting command line options. In Visual Basic for example,

CommandLine - "report.sqr acctg/acctg@T:sun:orac7 -keep"
Sqr0cx.LocalRun(CommandLine)

LocalRun() loads the SQR.DLL from the locally installed Production Reporting product, runs the Production Reporting program specified in the command line, waits until it finishes, and returns its return code. LocalRunNoWait(), launches SQR.EXE from the locally installed Production Reporting product and passes on the command line.

LocalRun and LocalRunNoWait look for the Production Reporting executables by checking the SQR.INI in the operating system’s system directory. Since Production Reporting is available in various versions supporting all major RDBMSs on the market, SQR.INI has different sections for each version installed, such as [Environment:Oracle], [Environment:ODBC], and so on. There is also a common section, [Environment:Common], for database-independent parameters.

The Production Reporting ActiveX Control has a property, DatabaseName, that guides LocalRun and LocalRunNoWait to locate the executables. If DatabaseName is valid, executables pointed to by the SQRDIR entry in that section are picked up; otherwise, [Environment:Common] is used. If SQR.DLL is not found, the Production Reporting ActiveX Control fails and throws an error exception.