Previous TopicNext Topic


Cell

The Cell element represents a cell in a table or a grid. Each grid or table row contains some number of cells. A cell can span multiple columns. It is not necessary for a design to contain a cell for every column. Columns without cells are presumed empty.

If a cell contains more than one item, the items appear vertically within the cell. The preferred method is to use a container to control the positioning of items when the cell contains multiple items.

While cell height and width are optional and seldom required, they are available for forcing a cell to a particular size.

Extends

Does not extend any element

Property summary

Method summary

Inherited properties

None

Slot summary

content

Style properties

backgroundColor, backgroundImage, borderBottomColor, borderBottomStyle, borderBottomWidth, borderLeftColor, borderLeftStyle, borderLeftWidth, borderRightColor, borderRightStyle, borderRightWidth, borderTopColor, borderTopStyle, borderTopWidth, canShrink, color, dateTimeFormat, display, fontFamily, fontSize, fontStyle, fontVariant, fontWeight, highlightRules, highlightTestExpr, letterSpacing, lineHeight, mapRules, mapTestExpr, marginBottom, marginLeft, marginRight, marginTop, masterPage, numberAlign, numberFormat, orphans, paddingBottom, paddingLeft, paddingRight, paddingTop, pageBreakAfter, pageBreakBefore, pageBreakInside, showIfBlank, stringFormat, textAlign, textIndent, textLineThrough, textOverline, textTransform, textUnderline, verticalAlign, whiteSpace, widows, wordSpacing

Cell methods

The following sections describe the methods of the Cell element.

onCreate

The method that BIRT executes to handle the onCreate event for this element. The onCreate method executes every time the element is generated. Use the onCreate method to perform tasks that are data dependent.

onPrepare

The method that BIRT executes to handle the onPrepare event for this element. the onPrepare method executes once prior to the generation of the report. Use onPrepare method to perform tasks that affect the appearance of the element for every occurrence in the report.

onRender

The method that BIRT executes to handle the onRender event for this element. The onRender method executes at run time and not at generation time. Use the onRender method to perform tasks that are dependent on the run time details. Examples of run time factors that might require special handling include the run time environment, the user requesting the report, the parameter values in effect when the report is run, and whether the report is produced in HTML or PDF format.

Cell properties

The following sections describe the properties of the Cell element.

colSpan

The number of columns that this cell spans. This value defaults to one, indicating that the cell appears in only one column.

column

The column in which the cell starts. Column numbering begins with column 1.

drop

A choice value that determines whether the cells in this row should expand to fill the entire table or group. This property allows creating a drop header within a table. It is ignored for grids and for cells that are not in group headers.

The following table itemizes the choices for this property.

Name
Display name
Value
Description
none
None
none
No drop header is created.
Detail
detail
detail
The header is merged with the cells of the detail rows, but not the footer rows.
all
All
All
The header is merged with the cells of the detail rows and the footer rows.

eventHandlerClass

The fully-qualified name of the Java class that contains the event handler methods for the Cell element.

height

Minimum cell height. The height of a cell is the smaller of the height of its contents and the value of this property. The final cell height is determined by the greatest cell height in the row. This property is generally omitted.

rowSpan

The number of rows that this cell spans. This property defaults to 1, meaning the cell appears in only one row.

style

Name of the style applied to this cell. Rows provide many style properties. A cell can inherit its style properties from a parent element, from a named style, or from a style that identifies the context in which the item appears. This property provides the name of the shared style. A cell can set the value of style properties. Properties set on the style element override those inherited from a parent element or a shared style.

width

Minimum cell width. A cell can have an absolute width or a relative width. If omitted, either BIRT or the browser computes the cell width based on content. The overall column width is the minimum of the value of this property and the width of the widest cell within the column. All cells are sized to the width of the column.

Cell slots

The following sections describe the slots that a Cell element contains.

content

Report items that appear inside the cell. A cell can contain any number of report items, including zero. The size of the item is the size of the cell. The x and y properties of the item are ignored. When a single item appears in a cell, the items within a row are aligned along the text baseline. If multiple items appear within a cell, alignment is undefined. Some rendering environments may baseline-align the first line, others may not.

When multiple items appear within a cell, each item functions as a section. A line break occurs after each item, causing the items to be vertically stacked. The user can set the display property of the items to create an in-line layout. Items flow from one line to the next with line breaks imposed by the cell width.

In-line layout applies only to the following report items:

When items appear in-line, an implied space separates the items. For example, if a grid has two labels, Sample and Labels, and they are marked as in-line, the resulting display is Sample Label, not SampleLabel.

The elements within a cell determine its alignment. When multiple items appear, each might have a distinct horizontal alignment. You can vertically align the complete set of items in a cell by setting all items to the same vertical alignment, either top, middle, base-line or center. If the multiple items have different vertical alignment, the behavior is undefined. In BIRT-controlled rendering environments, the first element determines the vertical alignment.

You can put multiple items in a cell by first adding a container, then adding the other items into the container. A container provides greater control over item positioning, including enhanced ability to place items side-by-side.


(c) Copyright Actuate Corporation 2006

Previous TopicNext Topic