The Label control displays plain text in a report. Drag the Label item from the Toolbox onto the report’s area to add a Label control to it.
Double-click the label to invoke its in-place editor and enter the desired static text.
Press CTRL+Enter to submit text changes and exit the label’s in-place editing mode.
Bind to Data
Display Field Values
You can bind the label’s Text property to a data field obtained from a report’s data source. Switch to the Properties panel, expand the Actions category and click the Expression property’s ellipsis button. Select the required data field in the invoked Expression Editor.
Click the Expression option’s ellipsis button to invoke the Expression Editor. You can use this editor to construct a complex binding expression involving two or more data fields.
You can also drag and drop a numeric or text field from the Field List to create a new label bound to this field.
The Process Duplicates Mode, Process Duplicates Target and Process Null Values options enable you to hide a control when a duplicated or null value appears in the assigned data source.
You can also use the Text Format String property to specify output values’ format.
Specify a data range in the Running property and select the summary function in the Expression Editor to display a summary function’s result in a label.
Adjust the Label Size and Content
You can change a label’s size to fit its static text using the Fit Bounds To Text command in the Actions category:
- If the Word Wrap option is enabled, the command displays control content in multiple lines. It reduces control height and adjusts its width to fit its content.
- If the Word Wrap option is disabled and the control’s content is partially visible, the command adjusts the control’s size to display this content.
This command’s result also depends on the control’s Text Alignment and Right To Left settings.
Use the Fit Text To Bounds button to adjust the control’s font size to fit its area. The Word Wrap option defines whether the text can occupy multiple lines or should be in a single line.
These commands are not available in the following cases:
- A label’s text is an empty string;
- A label’s text is bound to data;
- A label’s Angle property is specified.
The Can Grow and Can Shrink properties allow you to increase or decrease the control’s height according to its content in Print Preview mode.
|Can Grow is enabled||Can Grow is disabled|
|Can Shrink is enabled||CanShrink is disabled|
The Auto Width property specifies whether to adjust a data-bound label’s width to its content automatically.
You can also use the opposite Text Fit Mode property to adjust a control’s font size to fit its boundaries in Print Preview. This property is not available if the Can Grow, Can Shrink or Auto Width option is enabled.
|Text Fit Mode = None||Text Fit Mode = Grow Only||Text Fit Mode = Shrink Only||Text Fit Mode = Shrink And Grow|
Enable the Allow Markup Text property to format the label’s text with markup tags.
Label supports the following tags: