I have reached a point a little bit outside of my knowledge frame. Python.
I found that I can create multiple page reports with Python in ArcGIS Pro by combine 2 reports together. I am following this link from ESRI's site. I am using Report example 3.
I continue to get the following message :
Traceback (most recent call last):|File "<string>", line 6, in <module>
AttributeError: 'str' object has no attribute 'aprx'
I have tried several thing but lack an understanding.
What would my next step be?
Create a tool box that would allow me to make this a little more stream lined?
How do I define 'self'?
1 Answer 1
There is a missing part in example 3. self
is unknown. As @KHibma stated, it might be a part of a bigger project, probably a Python tool.
I am not able to test right now, but removing self
s and specifying aprx
would solve the problem if you don't make a python tool.
Try in this way:
import arcpy
aprx = arcpy.mp.ArcGISProject(r"C:\path\to\file.aprx") # add a full path
# other lines
report1 = aprx.listReports(...
report2 = aprx.listReports(...
# other lines
-
This is almost exactly what I ended up with. Thank you Kadir and @Khibma both for the input.KgEcology– KgEcology2021年02月19日 18:23:52 +00:00Commented Feb 19, 2021 at 18:23
self.aprx
, indicating that it may have been a copy of code from a bigger object.