AnsweredAssumed Answered

Advanced label expression crashing 10.2.2

Question asked by dpwhitehead on Jul 18, 2014
Latest reply on Jul 18, 2014 by dpwhitehead

I have been at this for a while and a little disappointed in the amount of money spent on this software and some of the seemingly easy things it should be able to do that it cannot. For example, being able to display a table of values from the attribute table as a label. So since that is not possible I have been trying to use my minimal coding skills to create a functional advanced expression. I have come up with the following

 

def FindLabel ([SWSID], [Stn_Name], [First_Date], [Last_Date], [Percentage], [First_Da_1], [Last_Dat_1], [Percenta_1], [First_Da_2], [Last_Dat_2], [Percenta_2], [First_Da_3], [Last_Dat_3], [Percenta_3]):

   

    label = ""

   

    flds = [[SWSID]]

    for fld in flds:

        label += "<und><bold>[SWSID]</bold></und>      <und><bold>[Stn_Name]</bold></und>\n" + "T_avg" + "  " + [First_Date]+ "  " + [Last_Date] + "  " +[Percentage]+"\n" + "Snowfall" + "  " + [First_Da_1]+ "  " + [Last_Dat_1] + "  " +[Percenta_1]+"\n"+ "Snow Depth" + "  " + [First_Da_2]+ "  " + [Last_Dat_2] + "  " +[Percenta_2]+"\n"+ "Rain" + "  " + [First_Da_3]+ "  " + [Last_Dat_3] + "  " +[Percenta_3]+"\n"

return FindLabel

 

When I try to do a verify, it crashes. So I thought, maybe it is too many variables, so I modified just for testing purposes to this

 

def FindLabel ([SWSID], [Stn_Name], [First_Date]):

   

    label = ""

   

    flds = [[SWSID]]

    for fld in flds:

        label += "<und><bold>[SWSID]</bold></und>      <und><bold>[Stn_Name]</bold></und>\n" + "T_avg" + "  " + [First_Date]

return FindLabel

 

Still crashing.... Any ideas on how to fix this issue or a different way to go about creating a table label. I'd like it to look something like below. It needs the row names but does not need the column headers in row 2, I have resigned to that. table.jpg

Outcomes