If you use Studio Printing and/or Reporting templates to generate map images from Studio Web apps, you may have noticed that feature highlights do not appear in the generated print/report when you use the Map Picture Box control. If you would like highlighted features to show up in your prints and reports, here are a couple ways you can set it up.
Method 1: Use the Get Map Screenshot Activity
NOTE: This method takes a snapshot of the map as it appears on the display and has no ties to the map data. Therefore, the scale may be inaccurate. If you require accuracy, please see Method 2.
This method requires that you use a workflow to run parameterized prints and reports instead of running them directly from your app. It's also worth noting that the output map image will show the current extent by default. To set it up so it zooms to each feature, displays a border around the map area, or allows modification of the extent, additional configuration is required.
Set Up the Print/Report Template
- Open the template in Printing/Reporting Designer.
- Add a new string parameter and give it an appropriate name like "mapImage".
- Replace the Map Picture Box control where you want highlighted features to appear with a Picture Box control.
- In the Properties menu for the Picture Box control, expand Picture Box Tasks.
- Open the Expression Editor (click the f icon) for Image Source. NOTE: It's important that you select Image Source, as Image URL will not work properly.
- Add the following expression, replacing "mapImage" with the name you gave your string parameter:
Base64Decode(?mapImage)
- Save the template.
Configure the Workflow
- Open a new workflow for VertiGIS Studio Web in Workflow Designer.
- Add a Get Map Screenshot activity.
- Add either a Run Print or a Run Report activity.
- Set it up using the URL to your template and any necessary inputs.
- Under Parameters, add the map image string parameter from your template and set its value to the output of the Get Map Screenshot activity. For example:
={
"mapImage": $screenshot1.dataUrl
}
- Save the workflow and add it to your Web app.
Method 2: Add Markup
Unlike highlight and focus symbols, markup that is added to a map does appear in prints and reports. Therefore, you can use workflows and/or Web commands like map.add-markup to either place markup on highlighted features or add markup automatically in place of highlights when performing a selection.
Many configurations are possible to get this to work. The following is one example:
- Import the attached workflow to Workflow Designer and save it. NOTE: This workflow is provided as a sample for the purposes of this article and is not intended as a ready-for-use solution.
- Create a new Web GIS - Default app in Web Designer or open an app with a similar configuration.
- Open the Results List component settings.
- Under Feature Actions, click the "Add Menu Item" button.
- Select the workflow you just imported.
- Save the app.
- Select some features using the Identify tool.
- Run the workflow from the Feature Actions menu.
- Run a print and check the output to see that the "highlights" are included.
- In the toolbar, click All Markup > Clear Markup to remove the graphics.
NOTE: This example uses VertiGIS Studio Web 5.27.0, VertiGIS Studio Workflow 5.37.0, and VertiGIS Studio Printing 5.21.2. Results may vary depending on the versions you are using.
Comments
0 comments
Article is closed for comments.