Skip to main content

FormattedRecordArea


The FormattedRecordArea layout element allows adding formatted text to a report.

The FormattedRecordArea element allows adding formatted text to a record area, which included HTML formatting elements embedded in the text. It also allows adding data from text or a field dynamically at runtime anywhere in between text. Add this layout element to a page or a report section's header, detail or footer. To embed JSON data, specify the field name between #...# and it populates the value at runtime.

info

Refer to designer-usersguide-examples for a GitHub example.

Add a FormattedRecordArea by right-clicking and selecting Add Formatted Record Area from the context menu.

Figure 1. Add a FormattedRecordArea by selecting Add Formatted Record Area from the context menu.

Text Example

For example, Dear #FirstName# #LastName#, in the JSON

The # symbol is a reserved character that is used to distinguish field names from static text. Hence, static content in FormattedRecordArea should not contain # symbols other than to specify field names. For example, the following string will cause an error because the first # symbol is a part of static content.

# of items in queue are #quantity#

Removing/replacing the first # symbol in static content as shown below will resolve the error. Alternatively, you could also escape the # sign by using another # sign, for example:

## of items in queue are #quantity#

Figure 2. Adding HTML text to a FormattedRecordArea layout element.

Figure 3. Adding a JSON field to a FormattedRecordArea layout element.

The FormattedRecordArea can be resized or repositioned using the mouse, manually changing the values in the properties window or by changing the values directly in the source.

tip

If you need to display a # as a character, then you escape it by using two ##. For example, to display "Work Order #:" in the resultant PDF, you would use enter Work Order ##: as the text in the text property.

caution

If your JSON dataset contains a field name with a dash or begins with a number, then you must surround the field name with square angle brackets. For example a field name of: field-one is written #[field-one]# in the text property's value.

The FormattedRecordArea element has the following properties.

Properties

PropertyValueDescription
leadingnumericA value indicating the leading of the text.
leadingTypeatLeast, auto, exactlyA value indicating how the leading is calculated.
alignnumericA value indicating the alignment of the FormattedRecordArea.
cleanParagraphBreakstrue, false
indentnumericA value indicating the first line indentation of the paragraph.
leftIndentnumericA value indicating the left indentation of the paragraph.
preserveWhiteSpacetrue, false
rightIndentnumericA value indicating the right indentation of the paragraph.
spacingAfternumericA value indicating the spacing after the paragraph.
spacingBeforenumericA value indicating the spacing before the paragraph.
colorSee Colors Users Guide topic.A value indicating the color to be used for the font.
faceenumeration (see below)A value indicating the font family to be used.
sizenumericA value indicating size of the font to be used.
texttextA value indicating the text of the FormattedRecordArea.
vAlignbottom, center, topA value indicating the vertical text alignment.
idtextA value indicating the programmatic identifier of the FormattedRecordArea.
anglenumericA value indicating the number of degrees to rotate the FormattedRecordArea.
expandabletrue, falseA value indicating if text area can be expanded or not.
heightnumericA value indicating the height of the FormattedRecordArea.
splittabletrue, false
widthnumericA value indicating the width of the FormattedRecordArea.
xnumericA value indicating the X coordinate of the FormattedRecordArea.
ynumericA value indicating the Y coordinate of the FormattedRecordArea.

Face property

The face property specifies the initial font used in the document. You can use HTML tags to customize how you use fonts within the text.

Figure 5. The face properties supported fonts.

Note on cleanParagraphBreaks Property

The cleanParagraphBreaks property being set to true will only have any affect on the FormattedRecordArea if the splittable property is also set to true. In other words the paragraph will not break at all (and therefore never needs to consider the type of break) if the splittable property is set to false. If however CleanParagraphBreaks is set to true and splittable is also set to true the will take care to make sure that any splitting performed on the FormattedRecordArea will always result in at least two lines of the paragraph being kept together (no orphaned lines). The only exception to this is if the paragraph itself is only one line then that one-lined paragraph will appear by itself.

Supported HTML Tags

The FormattedRecordArea class was designed to allow formatting within a paragraph of text using common and familiar HTML-style tagging. The FormattedRecordArea is not designed to support full HTML tags but it will accept the following HTML tags and attributes. Some of the attributes are in addition to the attribute found in HTML and are used for advanced paragraph and line properties. Please note that white space can be treated literally or ignored (standard behavior for HTML).

Bold Tag

<B.. tag - Enclosed text is bold.

Font Tag

<Font ... tag - For font attributes.

AttributeValuesDescription
ColorWeb Color Hex String.Color of the text.
FaceA string value.The font family to use for the text. The 5 built-in font families ("Times" | "Helvetica" | "Courier" | "Symbol" | "ZapfDingbats") can be specified or additional ones can be added through the HtmlTextArea's FontFaces property.
SizeAn integer value.Specifies the HTML font size for the text. This is mapped to a point size internally (0 = 6 points, 1 = 8 points, 2 = 10 points, 3 = 12 points, 4 = 14 points, 5 = 18 points, 6 = 24 points, 7 = 36 points).
PointSizeA decimal value.The size in points of the text.

Italics Tag

<I ... tag - Enclosed text is italics.

Enclosed text is italic.

Line Tag

<Line ... tag - Enclosed text is lined.

AttributeValuesDescription
LeadingA decimal value.The leading of the line.
LeadingTypeauto | atLeast | exactlySpecifies how leading is calculated.

Paragraph Tag

Attribute Values Description Align left | right | center | justify Alignment of the paragraph's text. AllowOrphanLines true | false Specifies if one orphaned line on a page has to be carried to the next page by itself or it will be carried along with the previous line to make it two lines on the next page. Indent A decimal value. The first line indentation of the paragraph in points. LeftIndent A decimal value. The left indentation of the paragraph in points. PreserveWhiteSpace true | false Specifies if white space should be preserved. RightIndent A decimal value. The right indentation of the paragraph in points. SpacingAfter A decimal value. The spacing after the paragraph in points. SpacingBefore A decimal value. The spacing before the paragraph in points.

Subscript Tag

<SUB ... tag - For subscript attributes.

AttributeValuesenscription
DisplacementA decimal value.The positive value will move the text downwards.

Superscript Tag

<SUP ... tag - For superscript attributes.

AttributeValuesDescription
DisplacementA decimal value.The positive value will move the text upwards.

Underline Tag

<U ... tag - Enclosed text is underlined.

Break Tag

<BR ...tag - Inserts a single line break.