Report Authors / Report Controls / Report Controls in Section Report / Label
Label

The Label control is available in Section reports and is very similar to the Section report's TextBox control, just that the Label control takes only the static text. The main difference between the two controls is the Angle property of the Label control, and the following properties of the TextBox control: CanGrow, CanShrink, CountNullValues, Culture, DistinctField, OutputFormat, SummaryFunc, SummaryGroup, SummaryRunning, and SummaryType.

Note: The CrossPlatform and the legacy GDI modes have different typography, so some text in migrated reports (for example, text without spacing, text with non-ASCII characters, etc.) may not appear correctly in the report preview. For the correct text rendering, you must manually update the report layout (for example, change the control's size).

Edit Mode

Double-clicking the Label control changes its mode to edit mode. In the edit mode, you can enter text directly in the control, or you can enter text in the Text property in the Properties panel.

Label Section Report control in edit mode

You can format text in the Label control in edit mode using the designer toolbar, or you can modify properties in the Properties panel. Formats apply to all of the text in the control. Text formatting changes from the Properties panel immediately appear in the control, and changes made in the toolbar are immediately reflected in the Properties panel.

Note: The TextBox and Label controls, unlike ReportInfo control, do not support page-related expressions.

Important Properties

Clicking the four-way arrow selects the control and reveals its properties.

Property Description
Angle Gets or sets the angle (slope) of the text within the control area. Set the Angle property to 900 to display text vertically.
CharacterSpacing Gets or sets the space between characters in points.
DataField Gets or sets the field name from the data source to bind to the control.
HyperLink Gets or sets a URL to which the viewer navigates when the user clicks the label at run time. The URL becomes an anchor tag or a hyperlink in HTML and PDF exports.
LineSpacing Gets or sets the space between lines in points.
MinCondenseRate Specifies the minimal rate of the text horizontal scaling in percentages. Should be between 10 and 100.
MultiLine Gets or sets a value indicating whether to allow text to break to multiple lines within the control.
ShrinkToFit Gets or sets a value indicating whether to decrease the font size so that all of the text shows within the boundaries of the control.
Style Gets or sets a style string for the label.
Text Gets or sets the text to show on the report.
TextJustify Specifies how to distribute text when the Alignment property is set to Justify. With any other Alignment setting, this property is ignored.
VerticalAlignment Gets or sets the vertical position of the label's text within the bounds of the control.
VerticalText Indicates whether to render the label's text vertically.
WrapMode Indicates whether a multi-line label control wraps words or characters to the beginning of the next line when necessary.

Label Dialog Properties

Name: Enter a name for the label that is unique within the report. This name is displayed in the Document Outline and in XML exports. You can only use underscore (_) as a special character in the Name field. Other special characters such as period (.), space ( ), forward slash (/), backslash (\), exclamation (!), and hyphen (-) are not supported.

Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object, but in the Properties panel or Property dialog, it is a string.

Visible: Clear this check box to hide the control.

DataField: Select a field from the data source to bind to the control.

Text: Enter static text to show in the label.

HyperLink: Enter a URL to use in the Viewer HyperLink event. The URL automatically converts to an anchor tag or hyperlink in PDF and HTML exports.

Keyboard Shortcuts

In edit mode, you can use the following keyboard shortcuts.

Key Combination Action
Enter New line.
Alt + Enter Saves modifications and exits edit mode.
Esc Cancels modifications and exits edit mode.