def FindLabel ( [Parcel_No], [Owner_Name] ): if [Parcel_No] >= 0: return "<CLR red='255'><FNT size = '14'>" + unicode( [Owner_Name]) + "</FNT></CLR>" else: return [Owner_Name]
You need the ";" after the &
it worked! It's the little things that get you.
def FindLabel ( [Owner_Name], [Owner_St], [Parcel_No], [Owner_City], [Owner_State], [Property_ID] ): parcelNo = "<BOL>" + "Parcel No.: " + "</BOL>" + [Parcel_No] propertyID = propertyID = "<BOL>" + "Property ID: " + "</BOL>" + [Property_ID] ownerTemp = [Owner_Name].title() ownerName = "<BOL>" + "Owner: " + "</BOL>" + ownerTemp.replace( '&', '&') streetAdd = "<BOL>" + "Address: " + "</BOL>" + [Owner_St].title() ownerCity = "<BOL><CLR black = '0'>" +"Address: "+ "</CLR></BOL>" + [Owner_City].title() LF= '\n' strResult = parcelNo+ LF+ propertyID + LF + ownerName + LF + streetAdd + LF + ownerCity + ", "+ [Owner_State] return strResult
thanks for you help. I tried the ";" after the & and get a syntax error. If I put it after the ")" it labels but still the "&" in the name.
The ampersand (&) and angle bracket (<) are special characters and will interfere with the formatting tags. You have to replace them with code similar to this: Function FindLabel ([LABELFIELD]) NewString = Replace([LABELFIELD],"&","&") FindLabel = "<ITA>" & NewString & "</ITA>" End Function See the help page on formatting tags
Function FindLabel ([LABELFIELD]) NewString = Replace([LABELFIELD],"&","&") FindLabel = "<ITA>" & NewString & "</ITA>" End Function
def FindLabel ( [Owner_Name] ): test = [Owner_Name].replace( '&', '&') return "<CLR red='255'>" + test + "</CLR>"
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.