The Runtime Class

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

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
Numeric getDebugLevel()
Returns the current debug level specified in the environment variable GREDEBUG, or 0 if no debug level was set.
String  getEnvironmentVariable(String variableName)
Returns the value of the specified environment variable.
String  getOutputDeviceName()
Returns the output device name
String  getPrinterMediaName()
Returns the media name.
String  getPrinterMediaSizeName()
Returns the media size name.
String  getPrinterMediaTray()
Returns the media tray name.
String  getPrinterName()
Returns the printer name.
String  getSVGPaperSource()
Returns the paper source.
String  getSVGPrinterName()
Returns the printer name.
Boolean inDesigner()
Returns TRUE if the report is currently being edited in Genero Studio; otherwise FALSE.
Boolean producingBrowserOutput()
Returns TRUE if the device name "Browser"; otherwise FALSE.
Boolean producingExcelOutput()
Returns TRUE if the device name "XLS" or "XLSX"; otherwise FALSE.
Boolean producingHLPXMLOutput()
Returns TRUE if the device name "HLPXML"; otherwise FALSE.
Boolean producingHTMLOutput()
Returns TRUE if the device name "HTML"; otherwise FALSE.
Boolean producingImageOutput()
Returns TRUE if the device name "Image"; otherwise FALSE.
Boolean producingOORTFOutput()
Returns TRUE if the device name "OORTF"; otherwise FALSE.
Boolean producingPDFOutput()
Returns TRUE if the device name "PDF"; otherwise FALSE.
Boolean producingPostscriptOutput()
Returns TRUE if the device name "Postscript"; otherwise FALSE.
Boolean producingPrinterOutput()
Returns TRUE if the device name "Printer"; otherwise FALSE.
Boolean producingPXMLOutput()
Returns TRUE if the device name "PXML"; otherwise FALSE.
Boolean producingRTFOutput()
Returns TRUE if the device name "RTF"; otherwise FALSE.
Boolean producingSVGOutput()
Returns TRUE if the device name "SVG"; otherwise FALSE.
Boolean producingXLSOutput()
Returns TRUE if the device name "XLS"; otherwise FALSE.
Boolean producingXLSXOutput()
Returns TRUE if the device name "XLSX"; otherwise FALSE.
Boolean producingForPreview()
Returns TRUE if preview ; otherwise FALSE.
Boolean xlsPagesAreMerged()
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()"