ArcGIS Enterprise

Printing Popups from Web Application

Great! I got your attention…

There are good and bad news. The bad news is that – inherently printing service does not support popups. Popups are client side UI controls to display attributes for selected features. Sometimes attributes are not even shown in popups controls, instead they are shown on a tabular grid or some other way that a web designer prefers. Often when we ask about ‘printing popups’, we mean print the map and ‘attributes of the feature(s) that are selected or queried on the map’.

Good news is that there are solutions. The post is about sharing two alternatives to tackle the issue.

Option #1: Using CustomTextElements and Web Application Builder Print Widget

This approach is simple and helpful in cases like when you want to print map with few information such as address, owner name, parcel-id for the selected parcel. And you need to define a layout for a specific layer or a specific task – it not meant to be applicable generically for all purposes.

Here is what needs to be done to achieve that:

a) Add CustomTextElements in the layout

CustomTextElements are text elements on the layout with names. To add a CustomTextElement in ArcMap layout…

TextElement Properties page

  1. Choose Text from Insert menu.
  2. Open the Properties page of the text element.
  3. Switch to Size and Position tab.
  4. Enter a name in Element Name.
  5. Click OK button.
  6. Repeat to add more text element as needed.
  7. Finish rest of the layout design.

b) Publish (or republish) a custom printing service with Get Layout Templates Info task

Get Layout Templates Info task is an arcpy script that gets installed as part of 10.4. For previous versions, you can download the script from GitHub.

Step by step instructions are provided in ArcGIS Server help to publish a custom printing service with Get Layout Templates Info task.

c) Use Print Widget in the Web Application Builder

Once you setup a print widget to use your custom printing service published in the previous section, the widget retrieves available CustomTextElements for each layout template by calling into Get Layout Templates Info task.

When you choose a layout with CustomTextElements on the Print widget, they appear in the Advanced drop-down allowing users to enter new values for those CustomTextElements. Fill them up and click Print, the widget will include CustomTextElements name-value pairs in the request to the printing service and the service updates those text elements with those values passed in and returns the output.

While this approach is very simple and no programming required, it has few challenges:

That leads to the 2nd option.

Option#2: Use custom ArcPy based Printing Service

Please Note: Due to an accidental side effect of an optimization that went in to ArcGIS API for JavaScript 3.21, this approach is not going to work for mapImage (aka dynamic map service) layer in ver 3.21, 3.22 and 3.23, and all client applications use one of these JS API versions – such as Web Application Builder’s (WAB) Print Widget that comes as part of ArcGIS Enterprise 10.6.

JS API v. 3.24 introduced a new option that allows a client application to control whether requests going to a print service includes attributes or not. WAB Print Widget is enhanced with this option in ArcGIS Online June 2018 release.

This is more flexible approach but requires python programming. The basic idea is that:

Note: for more information about creating an arcpy based printing, visit Server help.

A sample script tool with instructions and template mxds can be downloaded from http://www.arcgis.com/home/item.html?id=75bdfb3701c04ed8878e2ee561f291c4.

Here is what a sample output would look like:

 

Happy popup printing!!

About the author

Tanu is a product engineer on Esri Mapping Team focusing on map service, print service, and ArcGIS Pro. He also works on spatio-temporal analysis, spatial aggregation and real-time data. Tanu’s background includes a masters in Urban Planning from University of Akron, Ohio, USA and a bachelor degree from Khulna University, Bangladesh, and worked as GIS Coordinator in City of West Springfield, and GIS Specialist in a hydrology modeling center in Bangladesh before joining Esri.

Connect:
0 Comments
Inline Feedbacks
View all comments

Next Article

What's new in ArcGIS Hub first quarter

Read this article