Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Table inicialization

The 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:
JavaScriptVBScriptSelect and copy to clipboard

var i;
var oAxTable = pMe.Acx;
var nRows = 101;
var nCols = 4;
var Minimum = 20;
var Maximum = 90;

oAxTable.Dim(nCols, nRows, 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; i < nCols; i++)
  oAxTable.SetCellTextAlign(-3, i, 1);

//Filling up the table header:
oAxTable.SetCellText(0, 1, "Temperature");
oAxTable.SetCellText(0, 2, "Minimum");
oAxTable.SetCellText(0, 3, "Maximum");

oAxTable.SetCellForeColor(-3, 2, "#0000d0");  //color setting by RGB String
oAxTable.SetCellForeColor(-3, 3, "#ff0000");

for (i = 1; i < nRows; i++)
{
  oAxTable.SetCellText(i, 0, "Boiler" + i);
  oAxTable.SetCellText(i, 1, Pm.Round(Pm.Random(0, 100), 1));
  oAxTable.SetCellText(i, 2, Minimum);
  oAxTable.SetCellText(i, 3, Maximum);
}

//Setting the possibility to edit table columns:
oAxTable.SetCellEditable(-3, 0, 0);
oAxTable.SetCellEditable(-3, 1, 2);
oAxTable.SetCellEditable(-3, 2, 2);
PROMOTIC 8.3.26 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice