A script-enabled browser is required for this page to function properly.

About HTML formatting

Oracle Reports allows a variety of fonts, styles, and colors for text objects in your reports. Through the use of the SRW built-in procedures, you can allow end users to change text attributes at runtime to a whole object, but not to a section of the text (for example, different formatting for different parts of a text object). In prior releases, if a column contained rich text content, such as formatting instructions embedded within the text, this formatting was not interpreted or applied in the report output. While this limitation could be overcome by using HTML tags for formatting and setting the object's Contains HTML Tags property to Yes, the formatting could be seen only in HTML or HTMLCSS output; for reports generated to other bitmap output formats (for example, PDF, RTF, PostScript), the HTML tags themselves were shown in the output.

Oracle Reports 10g Release 2 (10.1.2) introduces text formatting enhancements that allow you to use a defined set of HTML formatting tags to format text style (bold, italics, underline, and strikethrough) and text attributes (font name, font color, and font size), and generate formatted text objects in all bitmap output formats supported by Oracle Reports when the objects' Contains HTML Tags property is set to Yes.

The text objects can have static values as in boilerplate text objects, or dynamic values as in field objects or text file link objects. A boilerplate text object can also have dynamic values if it references a field object or a report-level column. For boilerplate text, the formats specified at design-time are merged with rich text formats obtained at runtime. This feature also supports multibyte text containing HTML tags.

In the Paper Design view or Paper Layout view, you can choose the objects to which HTML formatting should be applied by setting their Contains HTML Tags property to Yes. If you run the report from the command line with CONTAINSHTMLTAGS=NO, Oracle Reports will not interpret the HTML tags for the report, regardless of the object's Contains HTML Tags property setting. For HTML and HTMLCSS ouput, the browser will interpret the HTML formatting tags; for other output formats, the HTML tags themselves will appear as is in the report output.

The following HTML tags are interpreted by Oracle Reports if they appear in a boilerplate text, text file link, or field object. Any HTML tags or attributes not listed appear as is in non-HTML/HTMLCSS report output.

Tag Result
<b>
<strong>

Text enclosed in either of these tags will be bold font.

For example:

If the text is formatted as
<b>my format</b>
the output will appear as
my format

<i>
<em>

Text enclosed in either of these tags will be italic font.

For example:

If the text is formatted as
<i>my format</i>
the output will appear as
my format

<u>

Text enclosed in this tag will be underlined.

For example:

If the text is formatted as
<u>my format</u>
the output will appear as
my format

<s>
<strike>

Text enclosed in either of these tags will be struck through.

For example:

If the text is formatted as
<s>my format</s>
the output will appear as
my format

<span>

Generic style container, used to specify font family, size, and color attributes, as decribed in the table below.

For example:

If the text is formatted as
<span style="font-family:Times New Roman; font-size:10pt; color:rgb (255, 0, 0);">my format</span>
the output will appear as
my format

The following table describes the supported properties for the span tag’s style attribute:

Property Description
font-family

This property specifies the font family name. Oracle Reports provides support for specifying only one font family name. If you specify a comma-separated list containing more than one font family name, Oracle Reports uses the system default font (usually Courier, or its equivalent) to render this tag, without generating a warning.

For example:

font-family: Arial

font-size This property describes the size of the font.

Oracle Reports supports the following options for this property:

absolute_size|length

where

Property

Values

absolute_size

xx-small | x-small | small | medium | large | x-large |
xx-large

where
xx-small is 7 points
x-small is 8 points
small is 10 points
medium is 12 points
large is 14 points
x-large is 17 points
xx-large is 20 points

length

font_sizepx | font_sizept

For example:

font-size:xx-large
font-size:12pt

color This property describes the color of the enclosing element's text content.

Oracle Reports supports the following options for this property:

color_name|#rgb|#rrggbb|rgb(r_integer, g_integer, b_integer)|rgb(r_value%, g_value%, b_value%)

Color Name

RGB Equivalent

aqua

#0FF

black

#000

blue

#00F

fuchsia

#F0F

gray

#7F7F7F

green #007F00
lime
#0F0
maroon
#7F0000
navy #00007F
olive #7F7F00
purple #7F007F
red #F00
silver #C0C0C0
teal #007F7F
white #FFF
yellow #FF0

For example:

color:aqua
color:#FB0
color:#0FACED
color:rgb(100, 245, 33)
color:rgb(23%, 45%, 87%)

Note: For rgb(x, x, x) specification, color intensity must be specified in percentage (0-100) or rgb integer (0-255). Any value higher than the allowable range is set to the maximum value. A negative value for any color intensity is invalid. You may mix the percent and rgb integer values for colors; for example:

<span style="color:rgb(100%, 125, 3%)">
is equivalent to:
<span style="color:rgb(255, 125, 8)">
or  
<span style="color:rgb(100%, 49%, 3%)">

Usage notes

Limitations

Examples

Example 1: Inline font change

In a boilerplate text object, you can specify the text boilerplate as follows:

<b>My</b>text

With the Contains HTML Tags property set to Yes, the formatted output will look like this:

My text

Example 2: Single line text with multiple formats

Assume a span of text (in a boilerplate object or database column) that formats on one line, such as:

<b>My <span style="color:#F00; font-family:Arial">HTML</span>
<u><span style="font-family:Times New Roman">Formats</span></u></b>

With the Contains HTML Tags property set to Yes, the formatted output will look like this:

My HTML Formats

Example 3: Multiline text with multiple formats

Assume a span of text that formats on multiple lines, such as:

Line 1: <i>My<u><span style="font-family:Arial">
Line 2: HTML</span><span style="font-family:Times New Roman;color:#FF33CC">
Line 3: Formatting</span></u></i>.

With the Contains HTML Tags property set to Yes, the formatted output will look like this:

Line 1: My
Line 2: HTML

Line 3: Formatting
.

Note in the preceding example that the formats are maintained in successive lines.

See also

About HTML and HTMLCSS output

Generating HTML or HTMLCSS output