Filling up the table

The following example fills up the column Temperature of the table from the example about the initialization of the table by values and the subsequent coloration of this column cells with respect to the Minimum and Maximum columns.

Let's have the PmiAx graphic item in the oAx variable placed in the image editor (this graphic item is set to the PmTable ActiveX object).

Dim i, Temperature, Minimum, Maximum, oAxTable
Set oAxTable = oAx.Acx
' *** Filling up the "Temperature" column with random values
For i=0 To (Rows-2)
  oAxTable.SetCellText 1, i, CInt(Rnd * 100)
' *** Checking the limits of values
For i=1 To (Rows-1)
  Temperature = CInt(oAxTable.GetCellText(1, i))
  Minimum = CInt(oAxTable.GetCellText(2, i))
  Maximum = CInt(oAxTable.GetCellText(3, i))
  If (Temperature > Minimum) And (Temperature < Maximum) Then
    oAxTable.SetCellBackColor 1, i, "#ffffff" 'color setting by RGB String
    If Temperature <= Minimum Then
      oAxTable.SetCellBackColor 1, i, "#a8ccf0" 'LightBlue
      oAxTable.SetCellBackColor 1, i, "#ff6868" 'LightRed
    End If
  End If
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice