I need to find the longest string of ALL cells of a table. Unfortunately, the table can have varying number of fields each time. Is it doable?
I'd recommend probably splitting it up into two seperate strings, each with a maximum string length. So your first string I guess you need left justified for the value of field one, with a max length of x(x being longest string in field) then concatenate that with a second string for the values of field two justified rightwith max length of y(ditto)(Since you mentioned you wanted similar to the example you posted).
This is more or less what I've been trying to do, but I still need the max length of the values, as well as max length of the field names. Otherwise I (and my other users) will have to calculate the numbers manually. I want to avoid it.
By the way, this kind of labels are called "spider diagrams" and are popular in the environmental industry, whether we like them or not.
Seems to me an approach that has a better chance of working is to to determine a label expression from your data and update it into the layer object rather than attempting to do all this processing in the labeling context.
Or maybe I'm missing what you are doing again?
BTW, see Posting Code blocks in the new GeoNet
The data come from a SQL Server DB, where I have no control, and can't create extra columns, etc. So the processing has to happen on the label side, for better or worse. The tables are different every time, as the number and name of fields.
Robert, I added a few notes below.