The Runtime Class

The Runtime class provides methods that simplify the creation of dynamic designs that change behavior based on the runtime setup.

Syntax

Runtime

Methods

Class methods are static methods that do not require an object. The method name is prefixed by the class name.

Table 1. Class Methods (Static Member Methods)
Name Description
getDebugLevel()
Numeric, returns the current debug level specified in the environment variable GREDEBUG, or 0 if no debug level was set.
getEnvironmentVariable(
   String variableName)
Returns a String containing the value of the specified environment variable.
getOutputDeviceName()

Returns a STRING indicating the output device name.

getPrinterMediaName()
Returns a STRING indicating the media name specified.
getPrinterMediaSizeName()
Returns a STRING indicating the media size name specified.
getPrinterMediaTray()
Returns a STRING indicating the media tray name specified.
getPrinterName()
Returns a STRING indicating the printer name specified.
getSVGPaperSource()

Returns a STRING indicating the paper source.

getSVGPrinterName()
Returns a STRING indicating the printer name.
inDesigner()
BOOLEAN; returns TRUE if the report is currently being edited in Genero Studio; otherwise FALSE.
producingBrowserOutput()
BOOLEAN; returns TRUE if the device name "Browser"; otherwise FALSE.
producingExcelOutput()
BOOLEAN; returns TRUE if the device name "XLS" or "XLSX"; otherwise FALSE.
producingHTMLOutput()
BOOLEAN; returns TRUE if the device name "HTML"; otherwise FALSE.
producingImageOutput()
BOOLEAN; returns TRUE if the device name "Image"; otherwise FALSE.
producingOORTFOutput()
BOOLEAN; returns TRUE if the device name "OORTF"; otherwise FALSE.
producingPDFOutput()
BOOLEAN; returns TRUE if the device name "PDF"; otherwise FALSE.
producingPostscriptOutput()
BOOLEAN; returns TRUE if the device name "Postscript"; otherwise FALSE.
producingRTFOutput()
BOOLEAN; returns TRUE if the device name "RTF"; otherwise FALSE.
producingSVGOutput()
BOOLEAN; returns TRUE if the device name "SVG"; otherwise FALSE.
producingXLSOutput()
BOOLEAN; returns TRUE if the device name "XLS"; otherwise FALSE.
producingXLSXOutput()
BOOLEAN; returns TRUE if the device name "XLSX"; otherwise FALSE.
producingPrinterOutput()
BOOLEAN; returns TRUE if the device name "Printer"; otherwise FALSE.
producingForPreview()
BOOLEAN; returns TRUE if preview ; otherwise FALSE.
xlsPagesAreMerged()
BOOLEAN, returns TRUE if page merging was selected; otherwise FALSE.

Usage

The class provides a number of methods that simplify the job of creating dynamic designs that change behavior based on the runtime setup.

With RTL classes, it is not possible to create and subclass objects. The new keyword is not supported.

The methods can be used from within RTL expressions. Some common uses might be:

  • To suppress headers and footers when Excelâ„¢ output is selected.
  • To conditionally Insert a logo based on the printer tray is selected.
  • To set a background color when debugging is enabled

These static methods do not require a Runtime object instance. When you invoke the method, it is prefixed with the Runtime class name and the '.' For example, you can suppress a header by setting its " visibilityCondition" property to this expression:

"!Runtime.producingExcelOutput()"