Run a report from an ArcGIS Notebook

You can use the Geocortex Reporting Client for Python package to run reports from ArcGIS Notebooks.

Prerequisites#

  • ArcGIS Online or ArcGIS Enterprise 10.7+
  • An ArcGIS user with permission to create and edit ArcGIS Notebooks
  • An existing Geocortex Report that accepts a FeatureIds parameter

Author the Notebook#

  1. Sign into ArcGIS Online or ArcGIS Enterprise as a Notebook Author user
  2. Create a new Notebook
  3. Add a cell with the following script:
!pip install geocortex-reporting-client
  1. Run the cell to install the geocortex-reporting-client package
  2. Add a cell with the following script:
from geocortex.reporting.client import run
report = await run("itemid", FeatureIds=[1, 2, 3])
print(report)
  1. Replace itemid with the ArcGIS item ID of your report
  2. Update the array [1, 2, 3] to contain the feature IDs of the features you want to generate the report for
  3. Run the cell to generate the report

ArcGIS Enterprise Support#

The same process applies to ArcGIS Enterprise 10.7+ but you must also supply the portal_url argument to the run method

report = await run(
"itemid",
portal_url="https://myportal.server.com/portal",
FeatureIds=[1, 2, 3]
)