Eclipse BIRT Report Object Model (ROM)

TextData Element

# Element Overview

Displays a multi-line block of text defined within the report.

### Details

Display Name: | Dynamic Text
Since: | 1.0
XML Element: | `text-data`
Extends: | ReportItem
Extendable: | Yes
Abstract: | No
Name Space: | Report Items
Name Requirement: | Optional
Allows User Properties: | Yes
Has Style: | Yes
Default Style: | text-data

### Property Summary

contentType
  The formatting within the text: HTML / plain text
hasExpression
valueExpr
  An expression that provides the text

### Method Summary

onCreate
  Script executed when the element is created in the Factory.
onPageBreak
onPrepare
  It is for a script startup phase. No data binding yet. The design of an element can be changed here.
onRender
  Script executed when the element is prepared for rendering in the Presentation engine.

### Inherited Properties

ACLExpression, allowExport, bookmark, bookmarkDisplayName, boundDataColumns, cascadeACL, comments, cube, customXml, dataBindingRef, dataSet, displayName, displayNameID, eventHandlerClass, extends, height, multiViews, name, newHandlerOnEachEvent, paramBindings, propertyMasks, pushDown, refTemplateParameter, style, theme, toc, userProperties, viewAction, visibility, width, x, y, zIndex

### Style Properties

backgroundAttachment, backgroundColor, backgroundImage, backgroundPositionX, backgroundPositionY, backgroundRepeat, bidiTextDirection, borderBottomColor, borderBottomStyle, borderBottomWidth, borderLeftColor, borderLeftStyle, borderLeftWidth, borderRightColor, borderRightStyle, borderRightWidth, borderTopColor, borderTopStyle, borderTopWidth, canShrink, color, display, fontFamily, fontSize, fontStyle, fontVariant, fontWeight, highlightRules, letterSpacing, lineHeight, marginBottom, marginLeft, marginRight, marginTop, masterPage, orphans, overflow, paddingBottom, paddingLeft, paddingRight, paddingTop, pageBreakAfter, pageBreakBefore, pageBreakInside, showIfBlank, textAlign, textIndent, textLineThrough, textOverline, textTransform, textUnderline, verticalAlign, whiteSpace, widows, wordSpacing

### Description

The text item allows the developer to provide the text as part of the report design. The multi-line data item displays blocks of text retrieved from the database, from a file, or from an expression. The text can be plain text, HTML. The format of the text can be fixed at design time, or can be dynamically selected at run time to match the format of the incoming text.

### See Also

Text element

# Property Detail

## contentType Property

The formatting within the text: HTML / plain text

### Details

Type: | choice (textDataContentType)
Since: | 1.0
Required: | No
Display Name: | Content type
JavaScript Type: |
Default Value: | None
Inherited: | Yes
Runtime Settable: | Yes
Property Sheet Visibility: | Visible
Property Sheet Group: | Top

### Choices

Name | Display Name | Value | Description
auto | Auto | auto | BIRT will infer the format as explained below.
plain | Plain | plain | Plain text with no formatting.
html | HTML | html | Formatting using a subset of HTML tags.
rtf | RTF | rtf |

### Description

The user can explicitly identify the format of the text using the Content Type property. Or, the user can set the property to "auto", (or omit the property) and BIRT will infer the format from the text itself.

BIRT determines the text format by examining the first few characters of the string. If the first characters are "<HTML>" (in either upper case or lower case), then the string is assumed to be HTML. Otherwise, the text is plain text. Any white space before these characters is ignored. That is, "<html>" and " <html>" are both taken to indicate that the text is formatted in HTML.

### See Also

## hasExpression Property

### Details

Type: | boolean
Since: | 2.5
Required: | No
Display Name: | Has expression
JavaScript Type: |
Default Value: | true
Inherited: | Yes
Runtime Settable: | Yes
Property Sheet Visibility: | Visible
Property Sheet Group: | Top

## valueExpr Property

An expression that provides the text

### Details

Type: | expression
Context: |
Expression Type: | string
Since: | 1.0
Required: | Yes
Display Name: | Value expression
JavaScript Type: |
Default Value: | None
Inherited: | Yes
Runtime Settable: | Yes
Property Sheet Visibility: | Visible
Property Sheet Group: | Top

### Description

The value expression provides the text to display. The expression is most often simply a reference to a query column. But, it can also reference a report parameter, a formula, a special value, a file, or other data item.

# Method Detail

## onCreate Method

Script executed when the element is created in the Factory.

### Synopsis

`None obj.onCreate( )`

### Details

Since: | 1.0
Context: | factory
Arguments: | None
Return Type: | None

### Description

Executed when the element is created in the Factory. Called after the item is created, but before the item is saved to the report document file. See the scripting spec for additional information about this script. Applications should perform visual customization in the on-render script instead.

## onPageBreak Method

### Synopsis

`None obj.onPageBreak( )`

### Details

Since: | 2.1
Context: | presentation
Arguments: | None
Return Type: | None

## onPrepare Method

It is for a script startup phase. No data binding yet. The design of an element can be changed here.

### Synopsis

`None obj.onPrepare( )`

### Details

Since: | 2.0
Context: | startup
Arguments: | None
Return Type: | None

### Description

It is for a script startup phase. No data binding yet. The design of an element can be changed here.

## onRender Method

Script executed when the element is prepared for rendering in the Presentation engine.

### Synopsis

`None obj.onRender( )`

### Details

Since: | 1.0
Context: | presentation
Arguments: | None
Return Type: | None

### Description

Executed when the element is prepared for rendering in the Presentation engine. Changes made to the element are written to the target output format, but not saved to the report document file. This is the preferred place for visual customizations.