Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Table inicialization

The following example initializes the table with four columns and 101 rows. Let's have number of table rows in the Rows variable, in the PmiAx graphic item in the oAx variable placed in the image editor.

Example:
Dim Cols, Minimum, Maximum, i, oAxTable
Set oAxTable = oAx.Acx
Cols = 4
Minimum = 20
Maximum = 90
oAxTable.Dim Cols, Rows, 1, 1, 100, 20, 3, true
  
' setting the default table font:
oAxTable.Font.Name = "Arial"
oAxTable.Font.Size = 10
oAxTable.Font.Bold = false
oAxTable.Font.Italic = false
  
' setting the font of the table fixed part:
oAxTable.FixedFont.Name = "Courier"
oAxTable.FixedFont.Size = 12
oAxTable.FixedFont.Bold = true
oAxTable.FixedFont.Italic = true
  
' setting the table colors:
oAxTable.BackColor = "#ffffff" 'color setting by RGB String
oAxTable.ForeColor = "#000000"
oAxTable.FixedForeColor = "#000000"
oAxTable.FixedBackColor = "#00ff00"
  
' text alignment of table cells:
For i=0 To Cols-1
  oAxTable.SetCellTextAlign i, -3, 1
Next
  
' filling up the table header:
oAxTable.SetCellText 1, 0, "Temperature"
oAxTable.SetCellText 2, 0, "Minimum"
oAxTable.SetCellText 3, 0, "Maximum"
  
oAxTable.SetCellForeColor 2, -3, "#0000d0" 'color setting by RGB String
oAxTable.SetCellForeColor 3, -3, "#ff0000"
For i=1 To (Rows-1)
  oAxTable.SetCellText 1, i, "Boiler" & i
  oAxTable.SetCellText 2, i, Minimum
  oAxTable.SetCellText 3, i, Maximum
Next
  
' setting the possibility to edit table columns:
oAxTable.SetCellEditable 1, -3, 0
oAxTable.SetCellEditable 2, -3, 2
oAxTable.SetCellEditable 3, -3, 2
oAxTable.Draw
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice