Ok, got it working… but is it possible to add bolding to only certain items? I would like to Bold Ignition billing, and the location/field/cost center, and the count and actual count number
I kind of modified it a little.
header = ["", “”, “”]
data = []
res = system.db.runQuery(“SELECT d.displayname, f.name, d.cost_center FROM devices d right outer join fields f on d.fieldid = f.id where d.ftg = 0 order by f.name asc”)
data.append([“IGNITION BILLING”, “”, str(system.tag.getTagValue("[System]Client/System/CurrentDateTime"))])
data.append(["", “”, “”])
data.append([“Location”, “Field”, “Cost Center”])
data.append([“FOC Wells”, “”, “”])
for row in res:
data.append([str(row[0]), str(row[1]), str(row[2])])
data.append([“COUNT”, “”, str(len(res))])
data.append(["", “”, “”])
res = system.db.runQuery(“SELECT d.displayname, f.name, d.cost_center FROM devices d right outer join fields f on d.fieldid = f.id where d.ftg = 1 order by f.name asc”)
data.append([“FTG Wells”, “”, “”])
for row in res:
data.append([str(row[0]), str(row[1]), str(row[2])])
data.append([“COUNT”, “”, str(len(res))])
event.source.getComponent(‘Table’).data = system.dataset.toDataSet(header, data)