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> |
Text enclosed in either of these tags will be bold font. For example: If the text is formatted as |
<i> |
Text enclosed in either of these tags will be italic font. For example: If the text is formatted as |
<u> |
Text enclosed in this tag will be underlined. For example: If the text is formatted as |
|
Text enclosed in either of these tags will be struck through. For example: If the text is formatted as |
|
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 |
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-size |
This property describes the size of the font.
Oracle Reports supports the following options for this property:
For example:
|
||||||||||||||||||||||||||||||||||
color |
This property describes the color of the enclosing element's text
content.
Oracle Reports supports the following options for this property:
For example:
Note: For
|
The supported output formats are: PDF, RTF, HTML, HTMLCSS, and PostScript.
HTML formatting supports interleaving and nesting of tags. For example, if you open an italics tag, it is applied to the point of its corresponding closing tag. If a tag is opened several times, it must be closed the same number of times for its effect to cease.
Format attributes are not inherited across instances of a text object of the same name or type (for example, if they are enclosed in a repeating frame). If, however, a text object contains multiple lines, formatting instructions are inherited across the lines of this object only.
This feature supports HTML tags that are hard-coded or referenced in a boilerplate text object. The tags can also be retrieved from a table column with a field object. A file link object that points to a text file which in turn contains HTML tags is also supported.
Oracle Reports tries to find the closest match according to the following criteria for fonts with the same character set:
font face > font size > font style > font weight > font width
If Oracle Reports nondefault match the font face, it will try to match the
font size; if it nondefault match the font size, it will try to match the font
style; and so on. For the font lookup alogrithm, refer to the chapter "Managing
Fonts in Oracle Reports" in the Oracle Application Server Reports
Services Publishing Reports to the Web manual, available on the Oracle
Technology Network Oracle Reports Documentation page (http://www.oracle.com/technology/documentation/reports.html
).
In font lookup, it is possible that the font used does not have all the
required attributes (such as style, size, and so on) embedded in data. In
this case, the unavailable font attributes do not appear in the report output.
A tag must be specified in its entirety on a single line. If the tag continues to the next line, it is not supported.
For example:
My<b
>format</b>
span
tag’s style
attribute font-family
property.
For example:
font-family:Arial
If you specify a comma-separated list containing more than one font name, Oracle Reports uses the system default font (usually Courier, or its equivalent) to render this tag, without generating a warning.
Entities such as "
are not supported.
For example:
<span style="font-family: "Courier New";">my
format!</span>
You must use literal double quote ("
) instead.
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
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
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.
Generating HTML or HTMLCSS output
Creating a boilerplate text object for HTML tags
Linking an HTML object to a file
Selecting HTML tags from the database
Copyright © 1984, 2005, Oracle. All rights reserved.