Class UserPlaceableText
Represents a text object that can be placed and aligned on a page in points, whereby the properties can be set directly using code or they can be taken from another source as an input mask or a configuration dataset. For instance, by providing an input mask or configuration dataset, program users can customize the positioning of the text objects within the page's header themselves. For more information, see the example Alignment of Header Objects.
public class UserPlaceableText : UserPlaceableObject
- Inheritance
-
UserPlaceableText
- Derived
- Inherited Members
Examples
public class ExampleReport : HeaderFooterReport {
public ExampleReport() {
Title = new UserPlaceableText("Example Report", TextFont, 0, AlignHor.Left, -50, AlignVert.Top);
}
Constructors
UserPlaceableText()
Initializes a new instance of the UserPlaceableText class with default settings.
public UserPlaceableText()
Remarks
The properties of the class HeaderFooterReport with type UserPlaceableText do not accept null values. In these cases, this default object can be assigned.
UserPlaceableText(FontProp, double, AlignHor, double, AlignVert, double)
Initializes a new instance of the UserPlaceableText class with specified font, positioning and alignment in points. As the text is not set, this element is not displayed as long as the Text property is not set.
public UserPlaceableText(FontProp font, double x, AlignHor alignHor, double y, AlignVert alignVert, double width = 1.7976931348623157E+308)
Parameters
font
FontPropThe font for the text.
x
doubleThe horizontal position of the text in points.
alignHor
AlignHorThe horizontal alignment of the text.
y
doubleThe vertical position of the text in points.
alignVert
AlignVertThe vertical alignment of the text.
width
doubleThe width of the text area in points. Defaults to MaxValue, indicating no width constraint.
Remarks
The default of property TextOptions is set to AdjustWidth and SmallerFontIfToolLong.
Exceptions
- ArgumentNullException
The font parameter is null.
UserPlaceableText(string, FontProp, double, AlignHor, double, AlignVert, double)
Initializes a new instance of the UserPlaceableText class with specified text, font, positioning and alignment in points.
public UserPlaceableText(string text, FontProp font, double x, AlignHor alignHor, double y, AlignVert alignVert, double width = 1.7976931348623157E+308)
Parameters
text
stringThe text content. The formatting options of the text are explained in class RepText, e.g.
This is an <i>italic title</i>
.font
FontPropThe font for the text.
x
doubleThe horizontal position of the text in points.
alignHor
AlignHorThe horizontal alignment of the text.
y
doubleThe vertical position of the text in points.
alignVert
AlignVertThe vertical alignment of the text.
width
doubleThe width of the text area in points. Defaults to MaxValue, indicating no width constraint.
Remarks
The default of property TextOptions is set to AdjustWidth and SmallerFontIfToolLong.
Exceptions
- ArgumentNullException
The text or font parameters are null.
Properties
Font
Gets or sets the font for the text.
public FontProp Font { get; set; }
Property Value
- FontProp
The font property, not nullable.
Text
Gets or sets the text content of this object. The default is an empty string.
public string Text { get; set; }
Property Value
- string
The text content, not nullable.
Remarks
If the value is an empty string, the object will not be created.
The formatting options of the text are explained in class RepText, e.g. This is an <i>italic title</i>
.
TextOptions
Gets or sets the text options, such as automatic width adjustment, alignment or font size reduction to fit the text. The default is set to AdjustWidth and SmallerFontIfToolLong. The text options are explained in class RepText.
public TextOptions TextOptions { get; set; }
Property Value
- TextOptions
The text options used to control text rendering.
Width
Gets or sets the width of the text area in points. Use MaxValue for no width constraint.
public double Width { get; set; }
Property Value
- double
The width of the text area in points.
WidthMM
Gets or sets the width of the text area in millimeters. Use MaxValue for no width constraint.
public double WidthMM { get; set; }
Property Value
- double
The width of the text area in millimeters.