Class TableCell
Represents a table cell.
Inheritance
Inherited Members
Namespace: FastReport.Table
Assembly: FastReport.dll
Syntax
public class TableCell : TextObject, IDisposable, IFRSerializable, ISearchable, IParent
Remarks
Use ColSpan, RowSpan properties to set the cell's column and row spans. To put an object inside the cell, use its Objects property:
TableCell cell1;
PictureObject picture1 = new PictureObject();
picture1.Bounds = new RectangleF(0, 0, 32, 32);
picture1.Name = "Picture1";
cell1.Objects.Add(picture1);
Constructors
TableCell()
Initializes a new instance of the TableCell class.
Declaration
public TableCell()
Properties
AbsLeft
Gets the absolute left coordinate of the object.
Declaration
public override float AbsLeft { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Overrides
AbsTop
Gets the absolute top coordinate of the object.
Declaration
public override float AbsTop { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Overrides
Address
Gets the address of this cell.
Declaration
[Browsable(false)]
public Point Address { get; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.Point |
CellData
Ges or sets data associated with this cell. For internal use only.
Declaration
[Browsable(false)]
public TableCellData CellData { get; set; }
Property Value
| Type | Description |
|---|---|
| TableCellData |
CellDuplicates
Gets or sets a value that determines how to display duplicate values in the cells of the same group.
Declaration
public CellDuplicates CellDuplicates { get; set; }
Property Value
| Type | Description |
|---|---|
| CellDuplicates |
ColSpan
Gets or sets the column span for this cell.
Declaration
public int ColSpan { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Height
This property is not relevant to this class.
Declaration
[Browsable(false)]
public override float Height { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Overrides
Objects
Gets a collection of objects contained in this cell.
Declaration
[Browsable(false)]
public ReportComponentCollection Objects { get; }
Property Value
| Type | Description |
|---|---|
| ReportComponentCollection |
RowSpan
Gets or sets the row span for this cell.
Declaration
public int RowSpan { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Table
Gets the TableBase object which this cell belongs to.
Declaration
[Browsable(false)]
public TableBase Table { get; }
Property Value
| Type | Description |
|---|---|
| TableBase |
Text
Gets or sets the object's text.
Declaration
public override string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Overrides
Remarks
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".
Width
This property is not relevant to this class.
Declaration
[Browsable(false)]
public override float Width { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Overrides
Methods
AddChild(Base)
Adds a child object to this object's childs.
Declaration
public void AddChild(Base child)
Parameters
| Type | Name | Description |
|---|---|---|
| Base | child | Object to add. |
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
CanContain(Base)
Gets a value indicating that this object can contain the specified child object.
Declaration
public bool CanContain(Base child)
Parameters
| Type | Name | Description |
|---|---|---|
| Base | child | Child object. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if this object can contain the specified child object; otherwise, false. |
Clone()
Creates the exact copy of this cell.
Declaration
public TableCell Clone()
Returns
| Type | Description |
|---|---|
| TableCell | The copy of this cell. |
Equals(TableCell)
Determines if two cells have identical settings.
Declaration
public bool Equals(TableCell cell)
Parameters
| Type | Name | Description |
|---|---|---|
| TableCell | cell | Cell to compare with. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if cells are equal. |
GetChildObjects(ObjectCollection)
Gets a list of child objects.
Declaration
public void GetChildObjects(ObjectCollection list)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjectCollection | list | List to fill with values. |
GetChildOrder(Base)
Returns z-order of the specified child object.
Declaration
public int GetChildOrder(Base child)
Parameters
| Type | Name | Description |
|---|---|---|
| Base | child | Child object. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Z-order of the specified object. |
Remarks
This method must return the index of a specified child object in the internal child list.
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.
RemoveChild(Base)
Removes a specified object from this object's childs.
Declaration
public void RemoveChild(Base child)
Parameters
| Type | Name | Description |
|---|---|---|
| Base | child |
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).
SetChildOrder(Base, Int32)
Sets the z-order of the specified object.
Declaration
public void SetChildOrder(Base child, int order)
Parameters
| Type | Name | Description |
|---|---|---|
| Base | child | Child object. |
| System.Int32 | order | New Z-order. |
Remarks
This method must place the specified child object at the specified position in the internal child list.
SetStyle(TableCell)
Changes the cell's style.
Declaration
public void SetStyle(TableCell style)
Parameters
| Type | Name | Description |
|---|---|---|
| TableCell | style | The new style. |
Remarks
Each cell in a dynamic table object (or in a matrix) has associated style. Several cells may share one style. If you try to change the cell's appearance directly (like setting cell.TextColor), it may affect other cells in the table. To change the single cell, use this method.
UpdateLayout(Single, Single)
Updates the children layout when the size of this object is changed by dx, dy values.
Declaration
public void UpdateLayout(float dx, float dy)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | dx | X delta. |
| System.Single | dy | Y delta. |
Remarks
This method must update positions/sizes of child objects whose Dock or Anchor properties are set to non-default values.