Creating a Report that Displays a Screenshot of the Map [Geocortex Tech Tip] - Geocortex

Creating a Report that Displays a Screenshot of the Map [Geocortex Tech Tip]

Patrick Fingler
Patrick Fingler
Technical Marketing Specialist
February 1, 2019


One of the elements we really can’t drill down on enough when it comes to Geocortex Reporting 5 is the amount of versatility this product has when it comes to visualization options. Whether it’s dynamic images, mailing labels, or attachments in your reports, there’s a lot you can do with this technology.

In this Geocortex Tech Tip, we wanted to focus on yet another popular visual component that we’ve had a lot of our customers asking about: displaying screenshots of your maps. Drawing upon capabilities of Geocortex Workflow 5, these screenshots can include any layers of your choosing, the current scale and extent, and you can even add custom graphics to mark up the map.

Have a look at how this works, as well as a real-world example featuring the New Hampshire Department of Environmental Services and how they used this functionality to search for contaminants within wellhead protection areas.

Watch on YouTube.

Video Transcript

“Hi everyone, my name is Patrick Fingler. I work on our technical marketing team, and in this Tech Tip video, I’m going to show you how to create a report that includes a screenshot of the current map.

Let’s take a look!”

In this Tech Tip video, I will show you how to create a report that displays a screenshot of the current map using Geocortex Reporting 5 as well as Geocortex Workflow 5.

One thing I’d like to mention right off the bat is that – in order for this process to work – you will need to be using the Geocortex Viewer for HTML5 as we are going to be calling the export map API that ships with Geocortex Essential.

If we wanted to just quickly see this in action, I’ve constructed a basic workflow and a basic report to my “I want to” menu. This is a workflow that I have created and when I click this, what it’s going to do is it’s going to get the current map extent. It’ll also get the current scale and then and it will send a web request to the export map API, generate an image of the current screenshot of the map and then pass that image as a hyperlink to Geocortex Reporting 5 as a parameter and then generate a report.

Here you can see, I’ve got a PDF report, but here I’ve just added a screenshot of the current map.

So, we can see I’ve got my zoning layer and it’s kind of hard to see, but you can see I’ve got my base map information underneath there as well. Essentially the same process as using the export map tool.

If I wanted to run this tool, essentially what I’m doing is when I click create image, it’s sending a web request; it’s gathering all the information on my maps. What layers have turned on, what the current scale and current extent is and then it’s constructing a screenshot or an image of that. I’m essentially passing this as a URL to my Geocortex Reporting 5 designer.

Now, if you want to investigate the API a little bit closer, we can navigate to Geocortex Essentials Manager, navigate to our site then to the site’s rest endpoint here.

At the bottom here, you can see there’s an export operation, if I click that, this is essentially the API that we’re calling and you can call this from workflow using to Send Web Request activity.

Here, I can pass in the bounding box which is essentially the map extents. I can set what layers I want to include, and I can also know what construct the image width and height that I want to be available in my report.

If you want to look at the back end of this workflow, it’s a pretty simple workflow.

Here I’ve just added it’s display form, if I double click the display form. What I’ve done is, I’ve added a text element called “text1” that just says generating a report. I’ve created a load event that fires, so just fires once I open the form.

What it’s doing is, it’s first getting the map extent so we can get at the extent as well as the scale of the map and then it’s using the Send Web Request activity to send a web request to my export map API rest endpoint.

Here, you want to just go back to this again. This is the URL that we are sending a web request to, and then we’re passing some parameters to it such as, the bounding box so we’re getting the map extent. The X-min and the Y-min, X-max and the Y-max, as well as what layers we want the image width and the image height, and you could also add additional options for this, but this is kind of what the object model looks like when you’re sending a web request to that API.

Here, you can see I’m actually going out and retrieving these values from the map extent activity, and hard coding some values, such as the output format. Determining that I wanted to get up as a PNG. I’m also kind of hard coding what layers I want to show.

In this example, this is the map service ID and this is the layer ID. If I navigate to my rest endpoint here, and just go back to my mapping tab, you can see the map service ID is 3, the layer is 0. The map service ID here is 2 and the layer ID is 0.

If you go back to my workflow, you can show that ID.

Here, I am constructing an image width and height, and then also dynamically passing in the scale from the map extent.

Once that is run, it essentially generates a href, which is a hyperlink and I’m passing that as a parameter to my report.

Here, I’ve just constructed a variable called mapExportUrl, which accepts the hyperlink value and then I am passing that as a variable to my Reporting 5 report.

Here, you can see that this is the URL to my report and then last, but not least, I’m just setting the description, I’m rewriting over the description. I’m setting the description to the clickable hyperlink, so it can then do that final report.

One of the key things here is, any time you’re passing a parameter to the report, this name here “mapExportUrl,” is case-sensitive, it must match the parameter in the report that you’ve created.

This is a very basic report that I created, it says that I’m not connected to any data layers or anything like that. I’ve just got a single parameter called “mapExportUrl”, it’s a string and here I’ve just added an image or picture box to my report. I just set the image URL property here.

If I navigate down the field and open up my parameters, it says “mapExportUrl”, so that’s pretty much the process of hooking all this up.

You can take it a little bit further by adding custom graphics and stuff and mark up to the map, and if you want to see an actual example of this running in an HTML 5 Viewer, this is a customer example, this is the New Hampshire Department of Environmental Services and we created this workflow that allows them to search for wellhead protection areas and determine if there are any contaminants within those wellhead protection areas.

In this example, they also have the ability to create a wellhead protection area on the fly.

I’m going to search for an address here, click continue and then I’m going to buffer my location here or, I could create a custom area here. I’m going to create an area like that and then click, “Generate Report”.

In this example, I am doing a couple of other things, so I’m also selecting some layers that intersect my area as well, but I’m also sending that web request to that map export API and creating an image of that or a screenshot of my map. I’m defining what layers I want to include in this. As well as, I’m also sending some of the custom graphics as well.

That is kind of a real-world scenario, where you might want this functionality.

Now, you can also if you just want to by default, get a screenshot of the map, you can use our out of the box printing tools. That is definitely another great way to accomplish this, but if you need to kind of combine all of this into a workflow where you also need to see some like layer information, then calling the map export API, this might be another option as well.

One quick thing I also wanted to highlight is, if you are a WebApp Builder customer, we are going to be introducing our Geocortex Printing 5 product and making it available in the WebApp Builder as a custom widget shortly.

You will also be able to generate these screenshots of your map within WebApp Builder.

That’s all for now. Thank you very much!”

Interested in learning more about how Geocortex Reporting 5 can help you to better gather, organize, and share your spatial data? Learn more about the technology, or schedule a demo by clicking the button below.

Discover Geocortex Reporting 5


Categories:
Archive
Open: 2018
2018
December 21, 2018

Integrating Pictometry, Bing and other 3rd party maps within your Geocortex applications

December 19, 2018

Recapping the Texas Geocortex Regional User Group

December 14, 2018

How to use Geocortex Workflow 5 to populate the Attribute Table in Web AppBuilder for ArcGIS [Geocortex Tech Tip]

December 12, 2018

Finding yourself: Using geolocation in mobile and web applications [Webinar]

December 7, 2018

Enabling real-time user-to-user map collaboration within Geocortex Essentials

December 5, 2018

Reflecting on 2018

November 30, 2018

Creating mailing labels with reports with Geocortex Reporting 5 [Geocortex Tech Tip]

November 29, 2018

Alberta Energy Regulator: Supporting safe and responsible energy resource operations

November 26, 2018

Important update for ArcGIS and Transport Layer Security (TLS) Protocol Support!

November 23, 2018

Using fine-grained security to control access to layers, features, attributes and application functionality [Geocortex Tech Tip]

November 21, 2018

Enhancing Web AppBuilder for ArcGIS® with Geocortex Reporting [Webinar]

November 16, 2018

Using Geocortex Workflow 5 to automatically display a form for editing layer attributes [Geocortex Tech Tip]

November 15, 2018

Geocortex Achieves Esri’s “Release Ready Specialty” Designation

November 14, 2018

Celebrating GIS Day with York Regional Police: How GIS Data Has Mitigated Risk & Increased Efficiency in Crime Prevention

November 9, 2018

How to access a SQL database from a workflow using Geocortex Workflow 5 [Geocortex Tech Tip]

November 2, 2018

How to send an email from a workflow using Geocortex Workflow 5 [Geocortex Tech Tip]

October 26, 2018

How to add and configure charts inside reports with Geocortex Reporting 5 [Geocortex Tech Tip]

October 24, 2018

Geocortex Water Webinar Series

October 19, 2018

Integrating Geocortex Essentials with ArcGIS Online and ArcGIS Enterprise portal [Geocortex Tech Tip]

October 17, 2018

Cross-Platform Development with Xamarin [Webinar]

October 12, 2018

City of Fort Collins: Dynamic flood maps for public awareness, and flood insurance rate saving

October 2, 2018

Technology Q&A: Geocortex Workflow 5 “Behind the Firewall”

June 27, 2018

Geocortex Essentials 4.10 is here!

June 12, 2018

Geocortex and the GDPR

June 6, 2018

Geocortex at the 2018 Esri User Conference

May 15, 2018

Technology Q&A: The evolution of Geocortex and Web AppBuilder for ArcGIS

April 25, 2018

How to manage data collected from Geocortex Workflow 5 forms [Geocortex Tech Tip]

April 18, 2018

Delivering accessible mapping applications for everyone [Geocortex Tech Tip]

April 11, 2018

How to search for data in a non-spatial database [Geocortex Tech Tip]

April 5, 2018

Configuring Geocortex Analytics to monitor a new Portal for ArcGIS instance [Geocortex Tech Tip]

March 27, 2018

Getting started with forms in Geocortex Workflow 5 [Geocortex Tech Tip]

March 21, 2018

Using Geocortex Workflow with Web AppBuilder for ArcGIS [Geocortex Tech Tip]

March 15, 2018

Understanding tool usage in your GIS applications [Geocortex Tech Tip]

March 7, 2018

Running Geocortex Essentials workflows from an identify operation [Geocortex Tech Tip]

March 2, 2018

GIS Health Assessment: A new way to think about your system

February 28, 2018

Using the in-app help system in Geocortex Workflow 5 [Geocortex Tech Tip]

February 21, 2018

How to configure a personalized dashboard in Geocortex Analytics [Geocortex Tech Tip]

January 25, 2018

GIS is shifting to SaaS, and it’s a win for everyone


Categories

Popular Tags
Accessibility Active Operating Picture ArcGIS ArcGIS Online Customer Story Data Models Energy Esri Geocortex Geocortex 5-Series Geocortex Analytics Geocortex Essentials Geocortex Mobile Viewer Geocortex Printing 5 Geocortex Reporting Geocortex Reporting 5 Geocortex Web Viewer Geocortex Workflow Geocortex Workflow 5 GIS GIS Day GIS Health Integrations Oil & Gas Pipelines Portal for ArcGIS SaaS Tech Tip Tech Tips Transportation Water Industry Web AppBuilder Web GIS Xamarin

Contributors