I am collecting data from various Lines and Machines and storing it in multiple tables. I often want to display this data on a window using a table where the column headings of the database table are in one column of a dataset and the value is in the next column. Basically I want to turn the table on it’s side.
I have the following function in a module that I call when I need to do this. This is working very well but I would like to sort the column names.
I would like to either sort by column name at the query definition or within the function. Is there a simple way to do this?
headers = 
for c in range(ds.getColumnCount()):
pyNewData = 
pyOldData = fpmi.dataset.toPyDataSet(ds)
for x in range(len(headers)):
strDetail = str(pyOldData[x])
dsSideways = fpmi.dataset.toDataSet(["Item","Value"],pyNewData)