Table of Contents
Each object is described in terms of functions and properties. The Property identifier is used to indicate the ability to both get and set a value. For example,
Property: A : String
indicates that the object has both String getA() and void setA(String a) functions. If the return type is a Boolean, then the naming follows the Java convention of using "is" in place of "get" - Boolean isA and void setA(Boolean a).
Where objects are identified as X extends Y, this indicates that all functions of Y are applicable to each X object.
Where colours are required to be provided as Strings, Elixir Report Designer supports all CSS standard names, including: "Black", "Blue", "Cyan", "Magenta", etc. See Figure 4.2, “Named Colours” for a complete list.
this.setBackgroundColor("Red");
Alternatively, an RGB value may be supplied, with an optional alpha transparency value. Values should be in the range 0-255:
this.setBackgroundColor("rgb(255,0,0)"); // red,green,blue
this.setBackgroundColor("rgb(255,0,0,128)"); // red,green,blue,alpha
To avoid possible conflicts with other libraries in future, these
functions which were previously global, have been moved to a namespace
elxfn
. For backwards compatibility they are still
also provided as global functions, but these will eventually be withdrawn.
A JavaScript warning will be logged for each use of a deprecated function.
Table 7.1. Core Object, Number and String functions
|
Table 7.2. Date functions
The allowed interval values for dateDiff are: "s","m","h","d" (seconds,minutes,hours and days). |
Table 7.3. Format
The Format object provides functions for manipulating and formatting text. The pattern definitions are described in the Java API.
|
Table 7.4. Log
The Log object interfaces with the Log4J logging mechanism used throughout Elixir Report Designer.
|
Table 7.5. Properties
The Parameters object provides a helper function to access report parameters. If this function is called from within a subreport it will return the subreport value for the property, but if not found there will return the parent report value instead. To set the parameter value you need to choose which report should hold the value and use the setParameter method of that RawReport (which could be either a master or a subreport). Similarly you can get a parameter from a report directly (ignoring master-subreport inheritance) by using the RawReport function getParameterValue. Properties is deprecated and is kept for backward compatibility.
|
Table 7.6. Renderer
The Renderer object provides an interface to the render engine.
There are two functions here,
|
Table 7.7. Data
The Data object represents the master datasource during section rendering. There are also helper methods for performing operations on named datasources. A number of the operations here return Function objects. The Function can then be applied to the desired record scope. See the Function object described below for more details.
|
Table 7.8. DataCache
Each DataCache object holds a data table in memory along with an index to the current record in the table. A DataCache is created by the DataCacheManager or by filtering an existing DataCache.
|
Table 7.9. DataCacheManager
The DataCacheManager provides an interface to load or discard DataCaches from memory.
|
Table 7.10. Function
A Function is returned by the Data object to represent the different operations that can be performed on data - for example getSum(fieldName). Given the function, you can execute it by specifying the range of records you want to be included in the result. For example, Data.getSum("Salary").getValueOverAll();
|
Table 7.11. GroupNode
A GroupNode represents a range of records - typically as a result of a grouping operation. GroupNodes form a tree structure with a single root which encompasses the whole datasource, which is then subdivided into child groups recursively, based on the section grouping configuration.
|
The current raw object is accessed as this
in the renderIf,
onRenderBegin, onRenderEnd and onLayout scriptlets.
See the RML-RawModel.pdf in /docs for full details of the raw objects.
Logical Report objects are only accessible in onRenderEnd and onLayout. They are
identified using the result
variable. Most raw elements
are converted to more than one logical element. For example, a raw Field is
rendered as a logical Rectangle which contains one or more logical Text objects -
one for each line of output. Accessing the Text within the result is illustrated
(in the onRenderEnd example above) like this:
field = result.getLogicalElement(0);
Where field is the first line of text in the result rectangle. You can query the number of child elements with:
count = result.getLogicalElementCount();
Wherever possible work with the raw objects, rather than the logical ones, as the dealing with logical objects requires an intimate knowledge of the rendering process and logical objects are more likely to change as new features are added.
See RML-LogicalModel.pdf in /docs for full details of the logical objects.