Class HtmlObject
Represents the Text object that may display one or several text lines.
Inheritance
Implements
Inherited Members
Namespace: FastReport
Assembly: FastReport.Base.dll
Syntax
public class HtmlObject : TextObjectBase, IFRSerializable
Remarks
Specify the object's text in the Text property. Text may contain expressions and data items, for example: "Today is [Date]". When report is running, all expressions are calculated and replaced with actual values, so the text would be "Today is 01.01.2008".
The symbols used to find expressions in a text are set in the Brackets property. You also may disable expressions using the AllowExpressions property.
To format an expression value, use the FastReport.Format property.
Constructors
HtmlObject()
Initializes a new instance of the HtmlObject class with default settings.
Declaration
public HtmlObject()
Properties
RightToLeft
Gets or sets a value that indicates whether the component should draw right-to-left for RTL languages.
Declaration
public bool RightToLeft { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Assign(Base)
Copies the contents of another, similar object.
Declaration
public override void Assign(Base source)
Parameters
Type | Name | Description |
---|---|---|
Base | source | Source object to copy the contents from. |
Overrides
Remarks
Call Assign to copy the properties from another object of the same type. The standard form of a call to Assign is
destination.Assign(source);
which tells the destination object to copy the contents of the source object to itself. In this method, all child objects are ignored. If you want to copy child objects, use the AssignAll method.
See Also
Break(BreakableComponent)
Breaks the contents of the object.
Declaration
public override bool Break(BreakableComponent breakTo)
Parameters
Type | Name | Description |
---|---|---|
BreakableComponent | breakTo | Object to put the part of content to that does not fit in this object. These two objects must have the same type. |
Returns
Type | Description |
---|---|
System.Boolean | true if there is enough space in this object to display at least one text line. |
Overrides
Remarks
Do not call this method directly, it is used by the report engine. You should override it if you are writing a new FastReport object.
This method must break the contents of the object. The part of content that fit in current object's bounds should remain in this object, the part that does not fit should be transferred to breakTo object.
CalcHeight()
Calculates the object's height.
Declaration
public override float CalcHeight()
Returns
Type | Description |
---|---|
System.Single | Actual object's height, in pixels. |
Overrides
Remarks
Applicable to objects that contain several text lines, such as TextObject. Returns the height needed to display all the text lines.
CalcWidth()
Calculates the object's width.
Declaration
public float CalcWidth()
Returns
Type | Description |
---|---|
System.Single | The width, in pixels. |
Draw(FRPaintEventArgs)
Declaration
public override void Draw(FRPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRPaintEventArgs | e |
Overrides
DrawText(FRPaintEventArgs)
Draws a text.
Declaration
public void DrawText(FRPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRPaintEventArgs | e | Paint event data. |
GetData()
Gets the data from a datasource that the object is connected to.
Declaration
public override void GetData()
Overrides
Remarks
This method is called by the report engine before processing the object.
Do not call it directly. You may override it if you are developing a new FastReport component. In this method you should get the data from a datasource that the object is connected to.
GetDataAsync(CancellationToken)
Declaration
public override async Task GetDataAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Overrides
GetExpressions()
Gets all expressions contained in the object.
Declaration
public override string[] GetExpressions()
Returns
Type | Description |
---|---|
System.String[] | Array of expressions or null if object contains no expressions. |
Overrides
Remarks
Do not call this method directly. You may override it if you are developing a new component for FastReport.
This method is called by FastReport each time before run a report. FastReport do this to collect all expressions and compile them. For example, GetExpressions method of the TextObject class parses the text and returns all expressions found in the text.
RestoreState()
Restores the object's state after printing it.
Declaration
public override void RestoreState()
Overrides
Remarks
This method is called by the report engine after processing the object.
Do not call it directly. You may override it if you are developing a new FastReport component. In this method you should restore the object properties that were saved by the SaveState() method.
SaveState()
Saves the object's state before printing it.
Declaration
public override void SaveState()
Overrides
Remarks
This method is called by the report engine before processing the object.
Do not call it directly. You may override it if you are developing a new FastReport component. In this method you should save any object properties that may be changed during the object printing. The standard implementation saves the object's bounds, visibility, bookmark and hyperlink.
Serialize(FRWriter)
Serializes the object.
Declaration
public override void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer | Writer object. |
Overrides
Remarks
Do not call this method directly. You should override it if you are developing a new component for FastReport.
This method is called when the object needs to save the state. It may happen when:
- saving the report to the file or stream;
- saving the report to the designer's undo buffer;
- assigning the object to another object using the Assign(Base) or AssignAll methods;
- saving the object to the designer's clipboard;
- saving the object to the preview (when run a report).