Select to view content in your preferred language

Create Custom Report for Public Notification Widget

5153
17
11-02-2020 11:40 AM
mthompson
Regular Contributor
I'd like to create a custom print service that uses a report template configured to pull the results of the Public Notification widget in one of our ArcGIS Online apps. I'd like to pull the value used as the "Search Distance" and one or 2 fields from the "Subject" feature as the header, and then a table of the parcels that intersect the buffer with several of their attributes.
In this image, the orange property would be the subject, and the blue properties would be the intersecting features.
I have created a Report in ArcGIS Pro, set up the look the way I want it and got the table to pull values from a selection I did in a Pro map. Right now the header data is all plain text except the dynamic date. I'm hoping it is possible to use tags or something to pull the necessary values from the Public Notification widget.
I am hoping this can be done without needing Developer Edition of Web AppBuilder, but am open to trying it out.
0 Kudos
17 Replies
TanuHoque
Esri Regular Contributor

@mthompson 

I'm so sorry for the delay.

Unfortunately I don't have good news for you at this point. I need to think it through a bit and see whether I can come up with some workaround.

Here are the big issues that you will face right off the bat:

  1. Apparently the Public Notification widget does not use print service, nor does it allow you to change its configuration to use a print service.
    • that could be an enhancement request for the widget
  2. Because of the above limitation, you need to do it in 2 steps
    1. use the Public Notification widget to select abutting properties, and
    2. then use the Print widget to generate a map and a report
  3. That leads to the next issue
    • after selecting all parcels using the Public Notification widget,
    • if you open the Print widget,
      • all selection gets cleared out
    • I found a workaround albeit very odd though
      • once Print widget is open, apparently you can still click on a parcel and perform the selection.
  4. Since the Public Notification widget and the Print widget are two different widgets, and they are disjointed, clicking the Print widget is not going to solve your problem.
  5. The print service on your server side, needs to be a custom arcpy based service.
    • because of #5, the request that comes to the print service, does not have all the information that you need for your report.
      • basically they need to be done again in the arcpy code
        • let me see whether I can come up with some solution very quick

 

Finally, would you mind share your .rptx file - the report file that you generated in ArcGIS Pro here. I can use that as a starting point.

Thanks

mthompson
Regular Contributor

Thank you very much for your reply, it seems this is a lot more difficult than I had hoped. I have attached a copy of the RPTX file.

0 Kudos
TanuHoque
Esri Regular Contributor

@mthompson 

Okay, I got something for you try. There are few hoops that we need to jump thru. That is because all the limitations that I mentioned above.
I will try my best to explain:

Here are two things that I have attached here:

  1. a sample output pdf containing a map and abutters list that will looks like this
    TanuHoque_0-1607536769641.png
  2. a zip file containing:
    • a gp tool with python files
    • a .pagx file (ArcGIS Pro layout file)
    • a .rptx file (ArcGIS Pro report file)
      • both pagx and rptx files are named the same
        • :warning:this is requirement.

 

What changes I made in .pagx & .rptx files:

  1. In layout template file (.pagx)
    • added a new text element
      • that is outside of the page to make sure it does not show up in the output
        • the report generation process use this later
      • this is named "{Buffer Distance}" - note it is embedded within a setup of curly braces
        TanuHoque_1-1607537339259.png
        • :warning: if you ever change its name, you need to update the python code
      • you will see later how and where it shows up in this workflow
    • if you want to use your own layout, that is okay, just make sure (a) it has one text element like this one, and (b) the pagx file must be named same as the rptx file
  2. In report file (.rptx)
    • The highlighted text below are like keywords that the python code looks for and replace them with correct values during a job.
      TanuHoque_2-1607538140447.png
    • :warning:if you ever wanted to replace them, you would need to update the python code too.

 

What do you need to do:

  1. Download the zip file and unzip in a local folder on your machine
  2. Update the .rptx file
    • open it in ArcGIS Pro
    • remove the layer in the map that will be imported in the Pro session as part of importing the .rptx file
    • add your parcel layer off your map or feature service
    • update field list used in the report's details section
    • Save it as a Report File -- over write the existing one
  3. Add the folder where you unzipped the zip file in Pro
  4. Open the Export Web Map script tool inside the Printing.tbx
    TanuHoque_3-1607539127640.png
    • choose the folder that has both .pagx and rptx file for Layout Template Folder
    • you will see the pagx file name showing up in Layout Template drop down
    • Run it
  5. Open Get Layout Template Info tool
    • choose the same folder that you selected in the step above
    • Run it
  6. Publish/share both gp results as a gp service
    see https://enterprise.arcgis.com/en/server/latest/create-web-apps/windows/tutorial-publish-additional-l... for more info
  7. Once published, use the service in a web app builder Print widget
  8. Once your web app is all setup correctly with a Public Notification widget and a Print widget, here is what you need to do:
    • click the Public Notification widget
      • click a parcel and let the selection process finish
    • click the Print widget - you will see all selection are cleared out
      • if you click on the parcel again, you will see the Public Notification process will still work 🙂
      • select AbuttersList Map and Report template
      • click Advanced button
      • you will see Buffer Distance text box
        • enter the buffer distance you used in the Public Notification widget
          this is the only thing you need to do manually. Unfortunately I didn't find any automated way to retrieve that info.
      • click Print button
      • now wait.... hopefully it will work fine on your side and you will get a pdf containing a map and abutters list 🙂
        HowToUseInWAB_animation.gif

Please let me if you run into any issues.

0 Kudos
LucasMNDNR
Emerging Contributor

 @TanuHoque

Would this also work if you had related tables?

0 Kudos
TanuHoque
Esri Regular Contributor

@LucasMNDNR 
would you mind explain a bit more on your requirements?

0 Kudos
LucasMNDNR
Emerging Contributor

@TanuHoque 

I have worked through several of your examples now and i can get them to work with just hosted features, but when i try to add related tables to my report the published tool fails to print. I have hosted features with 4 related tables. Link to RPTX file 

Just curious if you think related tables would be supported?

 

0 Kudos
TanuHoque
Esri Regular Contributor

hi @LucasMNDNR,

Sorry for the delayed response. Unfortunately it is not supported out of the box, as you have already figured out. I'm working on to find any workarounds. I will update you once I figure something out (or not).

 

thanks for sharing the rptx file.

 

0 Kudos
LucasMNDNR
Emerging Contributor

@TanuHoque

Any chance related tables have been incorporated yet?

MelanieWadsworth
New Contributor

I'm also interested in an answer about related tables. My widget is similar to the example, but I the fields from a related table do not display.