Setting up local distributed mode

This topic shows how to set up your system to run reports in local distributed mode.

Place report design documents on the daemon server

Place your report design documents (.4rp) on the server where the GRE daemon runs – the machine where you execute greportwriter. Ensure that all resources (images, schemas, etc.) are on the same server. When the resource files are defined using relative paths in the .4rp file, you must ensure the resources are in the same relative location when moved to the daemon server.

If the report design documents (.4rp) and localized string files (.42s) are in a different directory from where the GRE daemon runs, you must point to this directory using the FGLRESOURCEPATH environment variable. You usually set FGLRESOURCEPATH in the environment of the GRE daemon. However, you can also set FGLRESOURCEPATH using fgl_report_configureDistributedEnvironment() or fgl_report_setEnvironment(); for example, if you have multiple versions of the report and want to use a specific one depending on a runtime parameter.

Ensure that the fonts, images, and printers required for the reports are available; see Configure fonts and Configure printers.

Start the GRE daemon

Start the GRE daemon in listen mode with the -l portname option. The GRE daemon listens on the port specified by the -l option and for each connection attempts to read an XML document from the socket. For example (on UNIX®):
export FGLRESOURCEPATH=/usr/JohnDoe/TrackOrders/reports/
greportwriter -l 6500

You can optionally use the -o option. The -o option provides extra security by ensuring that the daemon accepts only local incoming connections. It must be used in conjunction with the -l option. For example:

greportwriter –l 5900 -o

Connect to the daemon using the reporting API

If you are using the reporting API, you must edit the source code to reflect that distributed mode is being used. This includes providing connection details, handle errors, and specifying the location for finished files.

To select and configure distributed processing, do one of the following:
Note:

If both GRESERVER and fgl_report_configureDistributedProcessing() are used, fgl_report_configureDistributedProcessing() takes higher precedence. If neither GRESERVER is set nor fgl_report_configureDistributedProcessing() is called, the GRE runs in non-distributed mode. The GRE also runs in non-distributed mode if GRESERVER is set but the daemon is not running. If you call fgl_report_configureDistributedProcessing() when the daemon is not running and a copy of the report definition file (.4rp) resides locally on the application server, the process automatically switches to running in non-distributed mode. You can receive notification of this switch to non-distributed by turning on debugging using the environment variable GREDEBUG on the application server.

.

This example is for a GRE daemon running on the local machine (host "localhost"):
IF NOT fgl_report_loadCurrentSettings("OrderReport.4rp") THEN   
  ...
END IF
...
CALL fgl_report_configureDistributedProcessing("localhost",6500)
RETURN fgl_report_commitCurrentSettings()

If required, configure the environment variables using the fgl_report_configureDistributedEnvironment() function. For example, you might want to set the FGLPROFILE environment variable for localization purposes.

Set up logging

If the GREDEBUG environment variable is set, the daemon logs messages of the specified level to the file gre.log in the home directory of the user invoking the daemon.

Important:

Sensitive and personal data may be written to the output. Make sure that the log output is written to files that can only be read by application administrators.

The API function fgl_report_setDistributedRequestingUserName() can set a user name in the log file in order to distinguish between log entries originating from different users.

You can redirect the log messages to a different file.

Set up the GAS (if required)

If you need to set up the GAS, see the Genero Application Server User Guide.

Set up the Genero Report Viewer for HTML5 (if required)

If you want to view the report in a browser, see View report in a browser.