The TextBox control is the basis of reporting as it is used to display text in section reports. You can bind it to data or set it at run time. It is the same control that forms when you drag a field onto a report from the Report Explorer.
Important Properties
Property | Description |
---|---|
CharacterSpacing | Gets or sets a character spacing in points. |
LineSpacing | Gets or sets a line spacing in points. |
OutputFormat | Gets or sets the mask string used to format the Value property before placing it in the Text property. |
Style | Gets or sets a style string for the textbox. |
TextJustify | Specifies text justification with TextAlign set to Justify. |
VerticalAlignment | Gets or sets the position of the textbox's text vertically within the bounds of the control. |
VerticalText | Gets or sets whether to render text according to vertical layout rules. |
CanGrow | Determines whether ActiveReports should increase the height of the control based on its content. |
CanShrink | Determines whether ActiveReports should decrease the height of the control based on its value. |
MinCondenseRate | Specifies the minimal rate of the text horizontal shrinking in percentages. Should be between 10 and 100. |
MultiLine |
Gets or sets a value indicating whether this is a multi-line textbox control. |
ShrinkToFit | Determines whether ActiveReports decreases the font size when text values exceed available space. |
WrapMode | Indicates whether a multi-line textbox control automatically wraps words or characters to the beginning of the next line when necessary. |
CountNullValues | Boolean which determines whether DBNull values should be included as zeroes in summary fields. |
Culture | Gets or sets CultureInfo used for value output formatting. |
DataField | Gets or sets the field name from the data source to bind to the control. |
HyperLink | Gets or sets the hyperlink for the text control. |
Text | Gets or sets the formatted text value to be rendered in the control. |
DistinctField | Gets or sets the name of the data field used in a distinct summary function. |
SummaryFunc | Gets or sets the summary function type used to process the DataField Values. |
SummaryGroup | Gets or sets the name of the group header section that is used to reset the summary value when calculating subtotals. |
SummaryRunning | Gets or sets a value that determines whether that data field summary value will be accumulated or reset for each level (detail, group or page). |
SummaryType | Gets or sets a value that determines the summary type to be performed. |
You can double-click in the TextBox control to enter edit mode and enter text directly in the control, or you can enter text in the Properties window or in code through the Text property.
You can format text in the TextBox control in edit mode using the ActiveReports toolbar, or you can modify properties in the Properties window. Formats apply to all of the text in the control. Text formatting changes in the Properties window immediately appear in the control, and changes made in the toolbar are immediately reflected in the Properties window.
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. |
In the End User Designer, you can disable this feature in the EditModeEntering and EditModeExit events.
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can click the Property dialog command to open the dialog.
General
Name: Enter a name for the textbox 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 (/), back slash (\), 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 window 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 textbox. If you specify a DataField value, this property is ignored.
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.
Appearance
Background Color: Select a color to use for the background of the textbox.
Font
Name: Select a font family name or a theme font.
Size: Choose the size in points for the font.
Style: Choose Normal or Italic.
Weight: Choose from Normal or Bold.
Color: Choose a color to use for the text.
Decoration: Select check boxes for Underline and Strikeout.
GDI Charset: Enter a value to indicate the GDI character set to use. For a list of valid values, see MSDN Font.GDICharSet Property.
GDI Vertical: Select this checkbox to indicate that the font is derived from a GDI vertical font.
Format
Line spacing: Enter a value in points to use for the amount of space between lines.
Character spacing: Enter a value in points to use for the amount of space between characters.
Multiline: Select this check box to allow text to render on multiple lines within the control.
Minimal rate of text horizontal shrinking (in %): Specify the percentage to which the text should be shrunk horizontally.
Can increase to accommodate contents: Select this check box to set CanGrow to True.
Can decrease to accommodate contents: Select this check box to set CanShrink to True.
Can shrink text to fit fixed size control: Select this check box to set ShrinkToFit to True.
RightToLeft: Select this check box to reverse the text direction.
Vertical text: Select this check box for top to bottom text.
Alignment
Vertical alignment: Choose Top, Middle, or Bottom.
Horizontal alignment: Choose Left, Center, Right, or Justify.
Justify method: Choose Auto, Distribute, or DistributeAllLines.
Wrap mode: Choose NoWrap, WordWrap, or CharWrap to select whether to wrap words or characters to the next line.
Note: You must select Justify in the Horizontal alignment property to enable the Justification method property options.
Wrap mode: Choose NoWrap, WordWrap, or CharWrap to determine whether and how text breaks to the next line.
Enter values in points to set the amount of space to leave around the label.
Summary
SummaryFunc: Select a type of summary function to use if you set the SummaryRunning and SummaryType properties to a value other than None. For descriptions of the available functions, see the SummaryFunc Enumeration.
SummaryGroup: Select a section group that you have added to the report. If you also set the SummaryRunning property to Group, the textbox summarizes only the values for that group.
SummaryRunning: Select None, Group, or All. If None, the textbox shows the value for each record. If Group, the textbox summarizes the value for the selected SummaryGroup. If All, the textbox summarizes the value for the entire report.
SummaryType: Select the type of summary to use. For descriptions of the available types, see the SummaryType Enumeration.
Distinct Field: Select a field to use with one of the SummaryFunc distinct enumerated values.
Count null values: Select this check box to include null values as zeroes in summary fields.