Class RichObject
Represents a RichText object that can display formatted text.
Inheritance
Inherited Members
Namespace: FastReport
Assembly: FastReport.dll
Syntax
public class RichObject : TextObjectBase, IComponent, IDisposable, IFRSerializable, ISearchable, IHasEditor
Remarks
Use the Text property to set the object's text. The text may include the RTF formatting tags.
Constructors
RichObject()
Initializes a new instance of the RichObject class with default settings.
Declaration
public RichObject()
Properties
ActualTextLength
Gets the actual text length.
Declaration
[Browsable(false)]
public int ActualTextLength { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
This property is for internal use only; you should not use it in your code.
ActualTextStart
Gets the actual text start.
Declaration
[Browsable(false)]
public int ActualTextStart { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
This property is for internal use only; you should not use it in your code.
ConvertRichText
Experimental feature for translation of RichText into report objects
Declaration
public bool ConvertRichText { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DataColumn
Gets or sets a name of the data column bound to this control.
Declaration
public string DataColumn { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Value must contain the datasource name, for example: "Datasource.Column".
KeepExpressionFormat
This property not described
Declaration
public bool KeepExpressionFormat { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
OldBreakStyle
Gets or sets the break style.
Declaration
public bool OldBreakStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Set this property to true if you want editable rich text when you edit the prepared report page.
PicturesInParagraph
Embedding pictures into text paragraphs instead of PictureObject
Declaration
public bool PicturesInParagraph { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Text
Gets or sets the object's text.
Declaration
public override string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Remarks
This property returns the formatted text with rtf tags.
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.
CanContain(Base)
Declaration
public bool CanContain(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child |
Returns
Type | Description |
---|---|
System.Boolean |
Deserialize(FRReader)
Declaration
public override void Deserialize(FRReader reader)
Parameters
Type | Name | Description |
---|---|---|
FRReader | reader |
Overrides
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
Draw(FRPaintEventArgs)
Declaration
public override void Draw(FRPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRPaintEventArgs | e |
Overrides
GetContextMenu()
Gets the object's context menu.
Declaration
public override ContextMenuBase GetContextMenu()
Returns
Type | Description |
---|---|
ContextMenuBase | Null reference if object does not have a menu. |
Overrides
Remarks
Do not call this method directly. You may override it if you are developing a new component for FastReport.
You may use base menu classes such as ComponentBaseMenu, ReportComponentBaseMenu to create own context menus.
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.
GetSmartTag()
Returns a "smart tag" menu.
Declaration
public override SmartTagBase GetSmartTag()
Returns
Type | Description |
---|---|
SmartTagBase |
Overrides
Remarks
"Smart tag" is a little button that appears near the object's top-right corner when we are in the designer and move the mouse over the object. When you click that button you will see a popup window where you can set up some properties of the object. FastReport uses smart tags to quickly choose the datasource (for a band) or data column (for objects).
InvokeEditor()
Invokes the object's editor.
Declaration
public bool InvokeEditor()
Returns
Type | Description |
---|---|
System.Boolean | true if object was succesfully edited. |
Remarks
This method is called by FastReport when the object is doubleclicked in the designer.
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).
UpdateLayout(Single, Single)
Declaration
public void UpdateLayout(float dx, float dy)
Parameters
Type | Name | Description |
---|---|---|
System.Single | dx | |
System.Single | dy |