Collapse AllExpand All

5.4. RPTRender Run Time Switches

The Report Renderer supports switches that enable values to be passed to it at run time. These switches and a description of their use are provided below:

-databaseURL=

Establishes the connection to the database.

-databaseURL=odbc:///

Contacts connects to the database through the ODBC connection called contacts.

-noAuth

Indicates that no username and password are required as is typically the case when this information is defined in the ODBC connection.

-username=

The database username.

-passwd=

The database user's password.

-param=

Establishes a parameter, its type and its value. For example -param=Caller_ID:string='3' establishes a parameter called Caller_ID of type string with a value of 3. This example, -param=show_inactive:bool='Y' establishes a parameter called showInactive of type boolean with a value of Y.

-print

The presence of this switch simply opens the operating system's print dialogue immediately upon opening the report renderer.

-printerName=

The value of this switch is the name of the printer that is selected automatically when the operating system's print dialogue is opened. This example, -printerName="Laser6l" will automatically select the client computer's printer with the name Laser6l.

-close

The presence of this switch simply closes the report renderer after the user prints or cancels printing.

Tip

When saving parameters to a report definition, the last position should contain the location and name of the OpenRPT report definition file. For example, on Windows this would look like this: c:\xTuple\Contacts-Calls-Report.xml

Below are two examples of scripts that call the report renderer, passing to it switch settings for a specified report definition.

Example script that connects to an ODBC data source
Example script that connects to a PostgreSQL data source

The switches that the report renderer enables make it possible for you to store OpenRPT XML report definition files on a shared drive and script end user access to them for ad hoc reporting capability.