Use of HTML in datasets and tables


I have a dataset in my client tag and I also have the whole data set in a power table. it consist of strings that are longer than my label can show and I know that I can add in front of the label but as soon as my label changes because of a parameter and it grabs a different string out of my data set it is gone. Is there a way to add HTML in such a way that my whole table is using it for strings or that my label is always using HTML?

if I add it in the text property it will be this:

but as soon my parameter changes value it will become this because it is grabbing a different string out of my data type

I don't have a concrete example at my finger tips...

But looking at the docs: Vision - Power Table Scripting Functions - Ignition User Manual 8.1 - Ignition Documentation you should be able to use the configureCell extension function of the power table.

Check which column you are in, and then add to the text and return it back to the table.

Another option would be to add this tag when you are getting the data, if the only place you are using it is in this PowerTable. If coming from SQL you should be able to add it in the query as well.

Something like this (Very Dirty and not tested in any shape or form)

def configureCell(self, value, textValue, selected, rowIndex, colIndex, colName, rowView, colView):
	if colIndex == 1: #Put the column index in here
		return {'text':'<HTML>{}'.format(textValue)}

it is coming from a csv file

Ah... OK. Then try the configureCell method and see what you get.

The label is the problem, correct? It's not the data in the table?

How are you getting the value into the label?

Yes the label is deleting the html everytime there is a new string being passed to it
my dataset is in a vision client tag and then I'm getting the string from it by using indirect tag with the following path:
the number between these {} brackets is the parameter that is passing the number so that it is grabbing a certain row.

OK so this isn't a table cell that you are trying to put in but a label?

If it is really a label add a custom property to the label and bind the tag to that. Then for the text of the label use a concat expression to put the before the custom property that you just added to the label.

1 Like

this works!! thanks for your help

1 Like