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; if the .4rp file uses relative directories,
you must also ensure that the resources are in the same relative location.
If the source files are in a different directory from where the GRE daemon runs, you must point
to this directory using the FGLRESOURCEPATH environment variable. Usually, you set FGLRESOURCEPATH
in the same environment as the GRE daemon. However, you can also set FGLRESOURCEPATH using
fgl_report_configureDistributedEnvironment()
, 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
-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.
- Set the GRESERVER environment variable.
- Call the API function
fgl_report_configureDistributedProcessing(host, port)
.
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, this results in an error.
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.
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.
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.
Set up the GAS (if required)
If you need to set up the GAS, see the Genero Application Server User Guide.
Start the Web server service (if required)
If you are using reports other than SVG, start the Web server service.
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.
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/).