Class TableBase
The base class for table-type controls such as TableObject and MatrixObject.
Inheritance
Inherited Members
Namespace: FastReport.Table
Assembly: FastReport.Base.dll
Syntax
public class TableBase : BreakableComponent, IFRSerializable, IParent
Constructors
TableBase()
Initializes a new instance of the TableBase class.
Declaration
public TableBase()
Properties
AdjustSpannedCellsWidth
Gets or sets a value that determines whether to adjust the spanned cell's width when breaking the table across pages.
Declaration
public bool AdjustSpannedCellsWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
If set to true, the spanned cell's width will be adjusted to accomodate all contained text.
ColumnCount
Gets or sets a number of columns in the table.
Declaration
public virtual int ColumnCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Columns
Gets a collection of table columns.
Declaration
public TableColumnCollection Columns { get; }
Property Value
Type | Description |
---|---|
TableColumnCollection |
FixedColumns
Gets or sets the number of fixed columns that will be repeated on each page.
Declaration
public int FixedColumns { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
FixedRows
Gets or sets the number of fixed rows that will be repeated on each page.
Declaration
public int FixedRows { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Item[Int32, Int32]
Gets or sets the table cell.
Declaration
public TableCell this[int col, int row] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | col | Column index. |
System.Int32 | row | Row index. |
Property Value
Type | Description |
---|---|
TableCell | The TableCell object that represents a cell. |
Layout
Gets or sets the table layout.
Declaration
public TableLayout Layout { get; set; }
Property Value
Type | Description |
---|---|
TableLayout |
Remarks
This property affects printing the big table that breaks across pages.
PrintOnParent
Gets or sets the value that determines whether to print the dynamic table (or matrix) on its parent band directly.
Declaration
public bool PrintOnParent { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
By default the dynamic table (matrix) is printed on its own band and is splitted on pages if necessary.
RepeatColumnHeaders
Gets or sets a value that determines whether is necessary to repeat table Column header on each page.
Declaration
public virtual bool RepeatColumnHeaders { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
To define a table Column header, set the FixedColumns properties.
RepeatHeaders
Gets or sets a value that determines whether is necessary to repeat table header on each page.
Declaration
public bool RepeatHeaders { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
To define a table header, set the FixedRows and FixedColumns properties.
RepeatRowHeaders
Gets or sets a value that determines whether is necessary to repeat table Row header on each page.
Declaration
public virtual bool RepeatRowHeaders { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
To define a table Row header, set the FixedRows properties.
ResultTable
Gets a table which contains the result of rendering dynamic table.
Declaration
public TableResult ResultTable { get; }
Property Value
Type | Description |
---|---|
TableResult |
Remarks
Use this property to access the result of rendering your table in dynamic mode. It may be useful if you want to center or right-align the result table on a page. In this case, you need to add the following code at the end of your ManualBuild event handler:
// right-align the table
Table1.ResultTable.Left = Engine.PageWidth - Table1.ResultTable.CalcWidth() - 1;
RowCount
Gets or sets a number of rows in the table.
Declaration
public virtual int RowCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Rows
Gets a collection of table rows.
Declaration
public TableRowCollection Rows { get; }
Property Value
Type | Description |
---|---|
TableRowCollection |
WrappedGap
Gets or sets gap between parts of the table in wrapped layout mode.
Declaration
public float WrappedGap { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Remarks
This property is used if you set the Layout property to Wrapped.
Methods
AddChild(Base)
Declaration
public void AddChild(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child |
Assign(Base)
Declaration
public override void Assign(Base source)
Parameters
Type | Name | Description |
---|---|---|
Base | source |
Overrides
Avg(TableCell)
Calculates an average of values in a specified cell.
Declaration
public object Avg(TableCell aggregateCell)
Parameters
Type | Name | Description |
---|---|---|
TableCell | aggregateCell | The cell. |
Returns
Type | Description |
---|---|
System.Object | The object that contains calculated value. |
Remarks
This method can be called from the ManualBuild event handler only.
Break(BreakableComponent)
Declaration
public override bool Break(BreakableComponent breakTo)
Parameters
Type | Name | Description |
---|---|---|
BreakableComponent | breakTo |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
CalcHeight()
Declaration
public override float CalcHeight()
Returns
Type | Description |
---|---|
System.Single |
Overrides
CalcWidth()
Calculates and returns the table width, in pixels.
Declaration
public float CalcWidth()
Returns
Type | Description |
---|---|
System.Single |
CanContain(Base)
Declaration
public bool CanContain(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child |
Returns
Type | Description |
---|---|
System.Boolean |
Count(TableCell)
Calculates number of repeats of a specified cell.
Declaration
public object Count(TableCell aggregateCell)
Parameters
Type | Name | Description |
---|---|---|
TableCell | aggregateCell | The cell. |
Returns
Type | Description |
---|---|
System.Object | The object that contains calculated value. |
Remarks
This method can be called from the ManualBuild event handler only.
CreateUniqueNames()
Creates unique names for all table elements such as rows, columns, cells.
Declaration
public void CreateUniqueNames()
Draw(FRPaintEventArgs)
Declaration
public override void Draw(FRPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRPaintEventArgs | e |
Overrides
GetCellData(Int32, Int32)
Gets data of the table cell with specified column and row numbers.
Declaration
public TableCellData GetCellData(int col, int row)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | col | The column number. |
System.Int32 | row | The row number. |
Returns
Type | Description |
---|---|
TableCellData | TableCellData instance containing data of the table cell. |
GetChildObjects(ObjectCollection)
Declaration
public virtual void GetChildObjects(ObjectCollection list)
Parameters
Type | Name | Description |
---|---|---|
ObjectCollection | list |
GetChildOrder(Base)
Declaration
public int GetChildOrder(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child |
Returns
Type | Description |
---|---|
System.Int32 |
IsInsideSpan(TableCell)
Declaration
public bool IsInsideSpan(TableCell cell)
Parameters
Type | Name | Description |
---|---|---|
TableCell | cell |
Returns
Type | Description |
---|---|
System.Boolean |
IsVisible(FRPaintEventArgs)
Declaration
public override bool IsVisible(FRPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRPaintEventArgs | e |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Max(TableCell)
Calculates a maximum of values in a specified cell.
Declaration
public object Max(TableCell aggregateCell)
Parameters
Type | Name | Description |
---|---|---|
TableCell | aggregateCell | The cell. |
Returns
Type | Description |
---|---|
System.Object | The object that contains calculated value. |
Remarks
This method can be called from the ManualBuild event handler only.
Min(TableCell)
Calculates a minimum of values in a specified cell.
Declaration
public object Min(TableCell aggregateCell)
Parameters
Type | Name | Description |
---|---|---|
TableCell | aggregateCell | The cell. |
Returns
Type | Description |
---|---|
System.Object | The object that contains calculated value. |
Remarks
This method can be called from the ManualBuild event handler only.
RemoveChild(Base)
Declaration
public void RemoveChild(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child |
RestoreState()
Declaration
public override void RestoreState()
Overrides
SaveState()
Declaration
public override void SaveState()
Overrides
Serialize(FRWriter)
Declaration
public override void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer |
Overrides
SetChildOrder(Base, Int32)
Declaration
public void SetChildOrder(Base child, int order)
Parameters
Type | Name | Description |
---|---|---|
Base | child | |
System.Int32 | order |
Sum(TableCell)
Calculates a sum of values in a specified cell.
Declaration
public object Sum(TableCell aggregateCell)
Parameters
Type | Name | Description |
---|---|---|
TableCell | aggregateCell | The cell. |
Returns
Type | Description |
---|---|
System.Object | The object that contains calculated value. |
Remarks
This method can be called from the ManualBuild event handler only.
UpdateLayout(Single, Single)
Declaration
public void UpdateLayout(float dx, float dy)
Parameters
Type | Name | Description |
---|---|---|
System.Single | dx | |
System.Single | dy |