I am posting this question here as well the Map Automation Forum, since it pertains to python and this forum seems to get a lot more action.My previous post (in the Map Automation Forum) regarding adding a text report of attribute data to an area in an MXD didn't yield any response, and probably isn't possible, so I am taking a new approach.To keep things simple, I have a text element in my MXD called "StateText1".When my cursor grabs the State attribute, it can replace that text string with the State. What I want to be able to do is, if there is more than one record, copy/paste that string (and rename it before I assign the value) to an x,y location. My python loop can then populate accordingly.
rows = arcpy.SearchCursor("lyr_sort")
row = rows.next()
n = 1
xState = 9.2
y = 9.25
while row:
stateValue = row.getValue("PROJECT_STATE")
for elm in MAP.ListLayoutElements(MXD, "TEXT_ELEMENT"):
if elm.text == "StateText" + str(n):
###(HELP) copy text string to x,y and assign elm.text = str("StateText" + str(n + 1))
if elm.text == "StateText" + str(n):
elm.text = (str(stateValue) + "\n")
elm.elementPositionX = xState
y = y - 0.25
elm.elementPositionY = y
n = n + 1
row = rows.next()