Back to Devexpress

CalculatedField.FieldType Property

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-calculatedfield-bcc9d078.md

latest6.1 KB
Original Source

CalculatedField.FieldType Property

Specifies the type of the value returned by the calculated field.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
[DefaultValue(FieldType.None)]
[SRCategory(ReportStringId.CatData)]
public FieldType FieldType { get; set; }
vb
<SRCategory(ReportStringId.CatData)>
<DefaultValue(FieldType.None)>
Public Property FieldType As FieldType

Property Value

TypeDefaultDescription
FieldTypeNone

A FieldType enumeration value, specifying the calculated field’s value type.

|

Available values:

Show 14 items

NameDescription
None

Indicates that the field’s type is undefined and determined by evaluating the actually returned object during report generation.

| | String |

Indicates that the field returns a string value as a sequence of UTF-16 code units (the String type).

| | DateTime |

Indicates that the field returns a value expressed as a date and time of day (the DateTime type).

| | Date |

Indicates that the field returns a value expressed as a date (the DateOnly type).

| | Time |

Indicates that the field returns a value expressed as a time of day (the TimeOnly type).

| | TimeSpan |

Indicates that the field returns a value as a time interval (the TimeSpan type).

| | Byte |

Indicates that the field returns an 8-bit unsigned integer value (the Byte type).

| | Int16 |

Indicates that the field returns a 16-bit signed integer value (the Int16 type).

| | Int32 |

Indicates that the field returns a 32-bit signed integer value (the Int32 type).

| | Float |

Indicates that the field returns a single-precision floating-point value (the Single type).

| | Double |

Indicates that the field returns a double-precision floating-point value (the Double type).

| | Decimal |

Indicates that the field returns a decimal value (the Decimal type).

| | Boolean |

Indicates that the field returns a Boolean ( true or false ) value (the Boolean type).

| | Guid |

Indicates that the field returns a globally unique identifier value (the System.Guid type).

|

Remarks

The FieldType property specifies the type of value (Boolean, DateTime, String, etc.) returned by a calculated field after evaluating its expression, specified via the CalculatedField.Expression property. All available value types are listed in the FieldType enumeration.

To learn more, refer to Calculated Fields Overview.

For a code example, refer to Creating a Calculated Field (Runtime Sample).

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FieldType property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

reporting-winforms-calculated-field-runtime/CS/UsingCalculatedFields/Form1.cs#L25

csharp
calcField.DataMember = report.DataMember;
calcField.FieldType = FieldType.Double;
calcField.DisplayName = "Calculated Field";

reporting-winforms-calculated-field-runtime/VB/UsingCalculatedFields/Form1.vb#L28

vb
calcField.DataMember = report.DataMember
calcField.FieldType = FieldType.Double
calcField.DisplayName = "Calculated Field"

See Also

Calculated Fields

DataMember

DataSource

Expression

CalculatedField Class

CalculatedField Members

DevExpress.XtraReports.UI Namespace