ActiveReports 18 .NET Edition
MESCIUS.ActiveReports Assembly / GrapeCity.ActiveReports.SectionReportModel Namespace / TextBox Class / OutputFormat Property
Example

In This Topic
    OutputFormat Property (TextBox)
    In This Topic
    Gets or sets the mask string used to format the Value property before placing it in the Text property.
    Syntax
    'Declaration
     
    Public Property OutputFormat As String
    public string OutputFormat {get; set;}
    Remarks

    The formatting mask can only be used to format numbers and dates.  There is no support for formatting alphanumeric strings.

    Setting the OutputFormat in the Format event of a control's section does not catch the first record. The reason for this behaviour is that the database values are applied to the the control BEFORE the Format event. If you change the OutputFormat in the Format event, set Control.Value=Control.Value so that the OutputFormat gets reapplied.

    Underscore (_) keycode can be used in OutputFormat property to skip the width of the next character. This code is commonly used as _) to leave space for a closing parenthesis in a positive number format when the negative number format includes parentheses. This allows both positive and negative values to line up at the decimal point.

    The OutputFormat property of the TextBox control includes four sections delimited by a semicolon.  Each section contains the format specifications for a different type of number:

    • The first section provides the format for positive numbers.
    • The second section provides the format for negative numbers.
    • The third section provides the format for Zero values.
    • The fourth section provides the format for Null or System.DBNull values.
    Example
    private void detail_Format(object sender, System.EventArgs eArgs)
    {
        this.txtShippedDate.OutputFormat = "MMMM";
        this.txtShippedDate.Value = this.txtShippedDate.Value;
    }
    Private Sub Detail1_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles Detail1.Format
        Me.txtShippedDate.OutputFormat = "MMMM"
        Me.txtShippedDate.Value = Me.txtShippedDate.Value
    End Sub
    See Also

    Reference

    TextBox Class
    TextBox Members

    Concepts

    Date, Time, and Number Formatting