FlexReport for WinForms | ComponentOne
C1.Win.FlexReport.6 Assembly / C1.Win.FlexReport Namespace / FieldBase Class / Name Property
Example

In This Topic
    Name Property (FieldBase)
    In This Topic
    Gets or sets the field name.
    Syntax
    'Declaration
     
    Public Overrides Property Name As String
    public override string Name {get; set;}
    Remarks

    The field name can be used as an index into the control's C1FlexReport.Fields collection.

    Field names are also used to identify fields in VBScript expressions, as shown in the example below.

    Duplicate and empty field names are allowed, but should be avoided if you plan to use the field names in scripts or as indexers.

    Example
    The code below assigns a script to the report's SectionTypeEnum.Detail section. The script changes a field's ForeColor property depending on a value.
    _c1r.Sections.Fields["sampleField"].ForeColor = Color.Black;
    _c1r.Sections.Detail.OnFormat = 
        "sampleField.ForeColor = iif(someValue < 5, vbRed, vbBlack)";
    See Also