OnFormatCell

<< Click to Display Table of Contents >>

 

OnFormatCell

OnFormatCell(Column, FieldName, OriginalValue, FormattedValue)

This event allows customizing the format of text on an E3Browser's cells. This event contains the Column parameter, which indicates the index of an E3Browser's visible column, starting at 0 (zero), and allows identifying the cell's column being formatted, the FieldName parameter, which indicates the text with the name of the column's field being formatted, the OriginalValue parameter, which indicates the cell's unformatted value, with a Variant data type, and the FormattedValue parameter, which indicates the formatted value, with a Variant data type, according to the configuration of E3Browser's column. If this parameter is changed inside this event, it allows changing the formatted text. The next example shows the formatting of Alarm fields.

Sub E3Browser1_OnFormatCell(Column, FieldName, OriginalValue, FormattedValue)
  If Column = 15 Then
    If Not IsNull(OriginalValue) Then
      FormattedValue = SourceTypeName(OriginalValue)
  ElseIf Column = 9 Then
    If OriginalValue = 0 Then
      FormattedValue = "High"
    ElseIf OriginalValue = 1 Then
      FormattedValue = "Medium"
    Else
      FormattedValue = "Low"
    End If
  End If
End Sub

Was this page useful?