Setting how data is formatted and calculated

Use the editor area to define the content of a template element or the values for formatting properties.

About this task

You can define the content of a template using simple values, data expressions, or script expressions. Data Expression is a value read from a data source while a scripted expression is a value calculated through a Java Script. The script can use any number of variables and/or data source properties. Only Java Script is supported in the script expression box by Rational Publishing Engine. The scripted expression box allows you to write javaScript to calculate a value while the data expression box allows you to select only one property (or variable).

Procedure

  1. In the editor area, double-click the text element. The Set content for current element window opens.
  2. Specify the content by using one of the following options:
    • To use a simple value, click the Simple value tab, type a value, and then click OK.
    • To use a data expression, click the Data expression tab, expand Variables and select the check box for the variable that you want to use. Expand Attributes, select the check box data attributes, and click OK.
    • To use a script expression, click the Script expression tab, expand Variables, and then enter Javascript code that can use the variables in the current context. Expand Attributes and enter Javascript code that can use the data attributes in the current context. Click OK. For example, to select the attributes as absolute number, name and value, type the Javascript code as:
      "object:"+Absolute Number+
      "attribute"+name+
      "value"+_value
      Tip: If you have created a fairly complex template, you can describe each block in the template using Properties > Metadata > Name and Description attributes. The name and description fields are empty by default, the name content will be displayed in the template, and the description content can be displayed in the template element hint field. This will help others when they use the template.

Feedback