I have a fence legend where I have rock and soil showing, as well as different groundwater level symbols. I would like some parts of the legend to disappear if not applicable to the fence. For example, if just one boring has a <<TABLE.Field>> populated but none of the rest of the borings do, if I try to use an output condition of <<HasData(<<TABLE.Field>>)>> it does not show in the legend. I don't think it is searching through all the borings.
If you have items that you do not want to display based on the presence or absence of data in a specific field for ALL the borings being output to a fence you need to use an sql command with an IN clause consisting of a list of the borings being output. Fortunately, gINT has data items that help you create that IN clause. For example, if I have a text entity that defines what SPT N means in a legend, and I do not want that entity to display if there are no SPT N values on the fence, I can place the following expression in the output condition of the text entity.
<<IIf(_ <<Sql(_ Select Count([SAMPLE].[Blows_1st_6in]) _ FROM [SAMPLE] _ WHERE [SAMPLE].[PointID] IN (<<OutputKeysInClause>>)_ )>> = 0,_ False,_ True_)>>
The OutputKeysInClause function generates a list of the borings selected for output ie 'B-1','B-2','B-3'. Thus the SQL command will count all the values in the field Blows_1st_6in for the PointID's of B-1, B-2, and B-3. If none of those borings have any entries for Blows_1st_6in, the returned count will be zero. The IIf statement compares the count to zero and if it is equal to zero it returns logical False and the entity does not print. Else it returns logical True. This is sort of a more complicated <<HasData>> function.
You will have to modify as required for what you actually want to do. Be careful with syntax in the sql command. Some items require SQL formatting for the table and field and some require gINT formatting.
Hope this helps.