Use Scripts in Print Templates

Scripting is available in on-premises installations of Geocortex Printing only. Scripting is not available in cloud Printing.

In on-premises installations of Geocortex Printing, you can include C# scripts in your print templates. A script is a custom event handler that is associated with a particular control.

Scripting is enabled by default in on-premises Printing. You can disable scripting if you want.

To use scripts in print templates, you must be familiar with C#.

Scripting allows print authors to write code that executes on your server. This can represent a security vulnerability if your print authors are not trusted.

To add a script to a print template:

  1. Open the print template in Print Designer.

  2. Select the control that you want the script to act on.

  3. Click Scripts and select the desired event from the drop-down list.

    Alternatively, select the control, expand Behavior | Scripts in the Properties panel, and click the icon beside the desired event.

    The script editor opens. The editor contains a script stub for the selected event.

    You can insert additional stubs for other events in the same manner.

  4. Type in the script. The script editor provides intelligent code completion.

    You can click Validate at any time to validate the script.

  5. When the script is valid, click Designer to return to the design surface.

  6. To test your script, preview the print template.

© 2019 Latitude Geographics Group Ltd. All Rights Reserved.

Documentation Version 5.0