Setting up remote distributed mode

This topic shows how to set up your system to run reports in remote 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, subreports, 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

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 connects to a daemon running on the remote server ("PrintServer"):
IF NOT fgl_report_loadCurrentSettings("OrderReport.4rp") THEN   
  ...
END IF
...
CALL fgl_report_configureDistributedProcessing("PrintServer",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.

Note:

The report definition files (4rp and all related resources) must reside on the GRE server.

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.

Start the Web server service (if required)

If you are using reports other than SVG, start the Web server service.

Specify the remote URL prefix

You must set the remote URL prefix when using the output format SVG with the Genero Desktop Client (GDC) running through the Genero Application Server, for example a http connection, or when using the output format Browser with the Genero Browser Client (GBC).

Set the remote URL prefix by specifying the <REPORT_REMOTE_URL_PREFIX> element in the as.xcf file.

When a different output format than SVG or Browser is selected, and if the Web server service grehttpd has been started on a different port than the default one, you can set the remote URL prefix with the API call fgl_report_configureDistributedURLPrefix().

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.

Note:

When you build the Browser document directory and Browser font directory, you must prefix them with the path to the document root on the GRE (Web) Server (for example C:/tmp/web/).