Class Column
This class represents a single data column in a DataSourceBase.
Inherited Members
Namespace: FastReport.Data
Assembly: FastReport.OpenSource.dll
Syntax
public class Column : DataComponentBase, IFRSerializable, IParent
Constructors
Column()
Initializes a new instance of the Column class with default settings.
Declaration
public Column()
Properties
BindableControl
Gets or sets a value that specifies the type of a control that will be created when you drop this column on a report page.
Declaration
public ColumnBindableControl BindableControl { get; set; }
Property Value
Type | Description |
---|---|
ColumnBindableControl |
Remarks
If you need to specify the custom type, use the CustomBindableControl property instead.
Calculated
Gets or sets a value that indicates whether this column is calculated.
Declaration
public bool Calculated { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
You should specify the Expression property for calculated columns.
Columns
Gets the collection of child columns.
Declaration
public ColumnCollection Columns { get; }
Property Value
Type | Description |
---|---|
ColumnCollection |
CustomBindableControl
Gets or sets a name of custom bindable control.
Declaration
public string CustomBindableControl { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Use this property if you want to bind a column to custom object type. You need to specify the type name of your object; that object must be registered in FastReport using the RegisteredObjects.Add method.
DataType
Gets or sets the type of data supplied by this column.
Declaration
public Type DataType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
Expression
Gets or sets expression of the calculated column.
Declaration
public string Expression { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This property is used if the Calculated property is true.
Format
Gets or sets the format of this column.
Declaration
public ColumnFormat Format { get; set; }
Property Value
Type | Description |
---|---|
ColumnFormat |
Remarks
This property is used when you drag a column from the Data window to the report page. FastReport will create a "Text" object and set its "Format" property to the corresponding format. By default, this property is set to Auto. It means that the format will be determined automatically depending on the DataType property.
PropDescriptor
Gets or sets the business object property descriptor which this column is bound to.
Declaration
public PropertyDescriptor PropDescriptor { get; set; }
Property Value
Type | Description |
---|---|
PropertyDescriptor |
PropName
Gets or sets the business object property name which this column is bound to.
Declaration
public string PropName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
AddChild(Base)
Adds a child object to this object's childs.
Declaration
public virtual void AddChild(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Object to add. |
CanContain(Base)
Gets a value indicating that this object can contain the specified child object.
Declaration
public virtual 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. |
GetChildObjects(ObjectCollection)
Gets a list of child objects.
Declaration
public virtual 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.
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 virtual void RemoveChild(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child |
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(Base) 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.
SetName(String)
Sets the object's name.
Declaration
public override void SetName(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | New name. |
Overrides
Remarks
This method is for internal use only. It just sets a new name without any checks (unlike the Name property setter).
See Also
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.